Install php5 and php4 in cPanel server

Now php has flushed their support for php4. Now most of the sites are loading under php5. But traditional php sites won’t work under php5. So we have to have php5 as primary and php4 as secondary php. Previously it was php4 as default and php5 as secondary, but now it is in the other way round.

Options to be added while configuring


1. Make sure that you are not using with-apxs option, as this would break existing php.

Install php5 and php4 in cpanel server. 2.Make sure you have the following prefixes and suffixes to install to the proper directories, otherwise currently installed php could be broken. --prefix=/usr/local/php4 --exec-prefix=/usr/local/php4 --program-suffix=4 3.Add the necessary options for proper CGI redirects from Apache: --enable-force-cgi-redirect --enable-discard-path An example configuration option would be ./configure --prefix=/usr/local/php4 --exec-prefix=/usr/local/php4 --program-suffix=4 --with-xml --with-gd --enable-exif --enable-mbstring --with-freetype-dir=/usr --enable-versioning --with-zlib --enable-force-cgi-redirect --enable-discard-path make make install


Integrating php4 with cpanel/cgi-sys


cp -f /usr/local/php4/bin/php4 /usr/local/cpanel/cgi-sys/php4 chown root:wheel /usr/local/cpanel/cgi-sys/php4 cp /usr/local/Zend/etc/php.ini /usr/local/php4/lib/php.ini Make sure that you add the following line to the php4 php.ini file. Make sure that you can't add this line if you are using a common php.ini file. cgi.fix_pathinfo = 1  ; needed for CGI/FastCGI mode


Integrating php4 in apache configuration


1. Add index.php4 entry in DirectoryIndex 2. Add the following entries after the AddType entry of default php5. These would make apache understand all .php4 files to execute as php4 Action application/x-httpd-php4 "/cgi-sys/php4" AddHandler application/x-httpd-php4 .php4 3.service httpd configtest 4. If there is no error in previous step service httpd stop service httpd startssl 5. put a info.php4 with the following contents in document root <? phpinfo(); ?> 6. Check the page whether it is showing php4 details
Both comments and pings are currently closed.

Comments are closed.