Using both php4 and php5 at the same time with custombuild

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » CustomBuild » ./build php

Using both php4 and php5 at the same time with custombuildLast Modified: Jul 9, 2009, 1:41 pm
If you wish to use both php4 and php5 at the same time, custombuild will allow you to do this.
Note that you must have  the 2 copies of php running as different types, one as CLI and one as CGI (suPhp).  You cannot have both running as CLI, and similarly you cannot have both running as CGI.

First, make sure you're running custombuild.
This is the guide to install it if you don't have it:

To setup both php4 and php5, you'll be editing the options.conf, eg:

cd /usr/local/directadmin/custombuild
nano options.conf

The php section of the options.conf should be changed to look like (Assumin php4 with cli, and php5 with cgi)

#PHP settings. default_php possible values - 4 or 5

Save/exit the options.conf.
Note that the default_php version (4 or 5) refers to what version of php files with extension .php will use.  You can also use .php5 and .php4 extensions to be explicit with which you want.

Once saved, you'll need to compile both phps, then rewrite apache configs.

./build php n
./build rewrite_confs

Note that when you convert to CGI (suPhp) from CLI.. it will be much more strict with it's rules about permissions and owernship.  If you get any "internal server errors", 500, etc... check the /var/log/httpd/suphp.log to see why, as well as /var/log/httpd/domains/ and  Ensure your files are chowned to your user (not root, or apache) and chmod to no more than 755.  With suPhp, you can run php files as chmod 700 for improved security.
Related Helpfiles
Allow php scripts to work under ~username when using suPhp (custombuild)
Setup a per-user php.ini to allow open_basedir with suPhp
Files uploaded with php scripts are owned by apache - how to install suPhp
Swapping between php versions when using suPHP and CLI with custombuild

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST