Running Multiple Version of PHP on a Server? Failed Attempt

Recently I was stuck in a weird problem, some of the scripts I used couldn't run on PHP 5.4 or higher, apparently some functions were deprecated or removed. I am not a coder, so editing the source was out of question, I mean it can be done but nah.

After some Googling I found the solution in, http://forum.nixtree.com/viewtopic.php?f=5&t=1344&sid=53cbe4b7004a2d9c35e2f59632afd424

It's called ntPHP, it's supposed to let you install different versions of PHP. However, it failed for me since my support installed Nginx as a reverse proxy.

Seeing that I couldn't fix the issue, I decided to revert it...

And boom, I fucked it up. Apparently the uninstall script has some issue and it leaves the ntPHP in cpanel default skin and it also add directives in Apache include file.


Include /usr/local/apache/conf/spdy.conf
Include /usr/local/apache/conf/rpaf.conf
Include /usr/local/apache/conf/php52.conf
Include /usr/local/apache/conf/php53.conf
Include /usr/local/apache/conf/php54.conf


If you try editing the file, it will give you an error.



To fix this, I basically just removed, everything except:
Include /usr/local/apache/conf/spdy.conf
Include /usr/local/apache/conf/rpaf.conf

and I updated the file, restarted the server and I was done :).

Now, I am just using PHP 5.5 and I updated everything else.



Comments

  • SlartibartfastSlartibartfast Global Moderator -__-
    I've only had to do this once. PHP doesn't like letting you do this. 

    I ened up creating "virtual machines" (really FreeBSD jails) for each php version, so php5.3 eas 10.1.1.50:7777 and php5.4 on 10.1.1.51:7777 but all on the same server. 

    The other way is to use a reverse proxy (nginx) to direct to the appropriate PHP install (who only accept connections from localhost nginx). 

    Sooner or later php has to man up and introduce a compatibility mode. 
  • DfgDfg Admin

    I've only had to do this once. PHP doesn't like letting you do this. 


    I ened up creating "virtual machines" (really FreeBSD jails) for each php version, so php5.3 eas 10.1.1.50:7777 and php5.4 on 10.1.1.51:7777 but all on the same server. 

    The other way is to use a reverse proxy (nginx) to direct to the appropriate PHP install (who only accept connections from localhost nginx). 

    Sooner or later php has to man up and introduce a compatibility mode. 
    I can't find Nginx config file, it's running but I can't find the process config :(
Sign In or Register to comment.