Using both php4 and php5 at the same time with custombuild

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:

http://files.directadmin.com/services/custombuild/1.1

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
default_php=5
php4_cli=yes
php4_cgi=no
php5_cli=no
php5_cgi=yes
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/domain.com.error.log and domain.com.log. 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.

 
scripts/php4_5.txt · Last modified: 2010/03/02 04:48 by muscardin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Please visit Automatic Backlinks to start earning free backlinks Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki