PDA

View Full Version : Running php4 on a php5 server


udjamaflip
11-04-2009, 09:37 AM
Hi guys,

We are about to finally move to a new php5 production server, and we know we have several php4 websites that won't run, I have heard through the Google grapevine that there are ways to get php4 served on a php5 server through using the following .htaccess:


AddType x-mapp-php4 .php
AddHandler x-mapp-php4 .php


However this only makes .php extensions be parsed as HTML rather than php4, any ideas? suggestions? myths? legends?

I'm struggling to find anything definitive on Google, or anyone attempting the same without running dual installations.

Hope somone can help! :thumbsup:

CFMaBiSmAd
11-04-2009, 12:09 PM
However this only makes .php extensions be parsed as HTML rather than php4Because php4 is not installed on the server, you cannot select it.

Under equivalent php.ini configurations, most code that runs under php4 will run as is under php5. There are very few incompatible differences going from php4 to php5 that are due to the php version. However, a lot of existing code is NOT using the current recommend php.ini settings (in some cases still relying on things that were depreciated and turned off by default over 7 years ago) and needs to be updated in order to run under the current recommend php.ini settings, regardless of the php version.

You would be better off spending your time finding out why your code won't work under the php5 php.ini settings and fix the code.

Given that the end of life and end of support for php4 was the end of 2007, you should have already budgeted time to update the code and any new code developed after that point should already work under the current recommended php.ini settings.

udjamaflip
11-04-2009, 02:31 PM
Despite me asking about howto get that specific method, you decided to not answer my question but infact tell me I'm wrong. Congrats on graduating as a fully feldged troll.

The fact is that you can run them in conjuction by running php4 as a CGI module rather than apache. Then by using similiar code to above you then reference what directories use php4 and what use php5.

Thanks for your help! :thumbsup:

CFMaBiSmAd
11-04-2009, 02:46 PM
You got an answer to your stated symptom -

However this only makes .php extensions be parsed as HTML rather than php4
Because php4 is not installed on the server, you cannot select it.


Without any relevant information from you about your server (it is common knowledge that you can selectively pick php4 and php5, but only if php4 is available), you got an answer with the best method on how to proceed to solve your problem.