Mobile app version of vmapp.org
Login or Join
Miguel251

: Issues trying to run PHP4 alongside PHP5 I’m trying to get PHP4 running under CGI alongside PHP5 as a module in Apache. Long story short, I have some legacy applications that aren’t running

@Miguel251

Posted in: #Apache #Php

I’m trying to get PHP4 running under CGI alongside PHP5 as a module in Apache. Long story short, I have some legacy applications that aren’t running under PHP5 and they would take a while to rewrite, so short term I should hopefully be able to run both PHP versions for now.

Most of the sites I’ve come across state that running one version as CGI and another as an Apache module is the best way to go about this. I’m pretty sure I have my httpd.conf setup properly as I’m no longer receiving “file not found” errors in my logs. Posting changes below for reference:

AddHandler php4-script .php4
Action php4-script "/cgi-bin/php4"

ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"


My current error is “Premature end of script headers: php4”. I’ve tried some diagnosis that I found here. If I run cgi-bin/php4 htdocs/test.php4 from the command prompt (where test.php4 is a simple echo phpinfo()), I get all the phpinfo data on screen, but no HTML formatting. I tried setting the PATH_TRANSLATE variable as the above link mentions and running cgi-bin/php4 but I never got any output doing that, possible issue could be this. Also I’ve checked and rechecked all my file permissions and everything looks good there.

Any other thoughts as to what I could be missing? Other option is to run another Apache instance on a different port, tried this at first but it started to get a bit messy, though I may have to revert to this.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

1 Comments

Sorted by latest first Latest Oldest Best

 

@Speyer207

see: www.deanspot.org/~alex/php5fcgi/index.html (Click on the symbol that looks like Theta, located in the right-bottom corner when you mouse over that area)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme