Portal Home > Knowledgebase > Articles Database > Running Multiple versions of PHP?
Running Multiple versions of PHP?
Posted by kshazad86, 02-14-2011, 07:44 AM |
Does anyone know how I can allow customers on a WHM server to run a php version of their choice.
For example some prefer v5.2.16 and others v5.3.x
So, can I allow people to have a different versions depending on their preference?
Last edited by kshazad86; 02-14-2011 at 07:48 AM.
|
Posted by ZenMonk, 02-14-2011, 08:23 AM |
Compile php cgi for both the version and add the following in .htacess for individual users.
AddHandler php-script .php
Action php-script /usr/bin/php5.2
or
Action php-script /usr/bin/php5.3
|
Posted by kshazad86, 02-14-2011, 08:46 AM |
Thanks man,
the server is currently running v5.6.12 and was installed via EasyApache.
Can you guide me on how I can install v5.3.4 so that I don't mess up the earlier version?
|
Posted by artemirk, 02-14-2011, 09:45 PM |
You need manyally compile v5.3.4 and manyally enable php-cgi file in some Virtualhosts.
For example create /usr/php53
Fetch php source from http://php.net/ and extract
./configure --prefix=/usr/php53
make
make install
And after you will have php-cgi executable file in /usr/php53/bin/php-cgi
Use it for some sites in you httpd.conf
|
Posted by kshazad86, 02-15-2011, 05:19 AM |
Ok, Ive now installed v5.3.5 from source like you said, and the install went through fine but I got a message saying:
"Warning! a PEAR user config file already exists from a previous PEAR installation at '/root/.pearrc'. You may probably want to remove it."
Is this something I should be worried about?
Also, you mentioned changing the httpd.conf file, but what do I change?
I thought I was supposed to change the .htaccess file for each user, or do I have to do both?
|
Posted by kshazad86, 02-15-2011, 01:29 PM |
Anybody????
|
Posted by artemirk, 02-15-2011, 10:19 PM |
Do not worry about PEAR.
You need crete link with php to your site
ln /usr/php53/bin/php-cgi ~/site.com/cgi/php-cgi
And .htaccess for site must be
AddHandler php-cgi .php5 .php
Action php-cgi /cgi-bin/php-cgi
|
Posted by kshazad86, 02-16-2011, 06:27 AM |
When I place the .htaccess file in the root folder or the public_html folder, I get an internal server error message when I try to access phpinfo page, and an additional 404 error message.
|
Add to Favourites Print this Article
Also Read
PostgreSQL (Views: 595)