Forum Moderators: coopster

Message Too Old, No Replies

advice on running php 4 and 5

best way for php 4 and 5

         

stevenjm

10:24 am on Nov 27, 2008 (gmt 0)

10+ Year Member



Hi,
i'm just wanting some advice on running php 5 as well as 4.4.1 on my server.

I had php 5 installed and then went back to 4.4.1 but what i really need is both. Can i install 4 and 5 and just restart with a different http config file each time one or the other is needed.

Whats the best way to get around this, I dont want to fix code each time to make compatible as i do a lot of testing and development of existing scripts and would lose too much time.

Ive got apache 2, php 4.4.1 and mysql 5 installed on osx 10.4.11
not the bundled version.

any advice much appreciated. thanks.

phparion

4:09 pm on Nov 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



one way to achieve this is to install one php version, which you uses most, as apache module and rest of the versions, as much as you can, as CGI applications for apache. then hear different versions on different ports by modifying httpd.conf e.g

<VirtualHost *:80>
LoadModule php5_module "E:/php5/php5apache2_2.dll"
PHPIniDir "E:/php5"
php_value extension_dir "E:/php5/ext/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</VirtualHost>

<VirtualHost *:8447>
# it would be handy to use php_value directives, but CGI versions of php will not grok them,
# so we rely on different php.ini
SetEnv PHPRC "E:/php4/"
ScriptAlias /php447/ "E:/php4/"
Action application/x-httpd-php447 "/php447/php.exe"
AddType application/x-httpd-php447 .php .inc
# apache 2.2 denies access to the php cgi executable, unless it is explicitly granted
<Directory "E:/php4/">
<Files "php.exe">
Allow from all
</Files>
</Directory>
</VirtualHost>

<VirtualHost *:8423>
SetEnv PHPRC "E:/php423/"
ScriptAlias /php423/ "E:/php423/"
Action application/x-httpd-php423 "/php423/php.exe"
AddType application/x-httpd-php423 .php .inc
<Directory "E:/php423/">
<Files "php.exe">
Allow from all
</Files>
</Directory>
</VirtualHost>

[localholhost:8423...] [localholhost:84447...]

phparion

4:12 pm on Nov 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



by the way it was for windows, i am not a user of Mac, you can convert the idea to Mac settings.