thepreacher Posted July 12, 2009 Share Posted July 12, 2009 I have both php 5.2.x and php 5.3 setup and working on apache2.2. However when i try to switch between them apache restart fails depending on which one of the directories appears in the environment path first. eg. I an currently runing php 5.2 and on the environment path i have ;c:\php5.2;c:\php5.3;... in httpd.conf i have ####### PHP Config ########### LoadModule php5_module "C:/php5.2/php5apache2_2.dll" AddType application/x-httpd-php .php .phtml .php3 PHPIniDir "C:/php5.2" #LoadModule php5_module "C:/php5.3/php5apache2_2.dll" #AddType application/x-httpd-php .php .phtml .php3 #PHPIniDir "C:/php5.3" ############################## To switch to php 5.3 i uncomment the line for ver 5.3 and comment out those for ver 5.2 then I save and restart apache. However i get a failure message. unless i go into the environment path on windows and then reverse their positions ;c:\php5.3;c:\php5.2;... and reboot before it works. Is there an easier way to switch between two versions of php without the constant path chnage and rebooting? I don't want to use xampp or wamp. Quote Link to comment https://forums.phpfreaks.com/topic/165738-difficulty-switching-between-php-52x-and-php-53-on-apache/ Share on other sites More sharing options...
wildteen88 Posted July 13, 2009 Share Posted July 13, 2009 The problem is when use PHP5.3 it will use the .dlls for 5.2.x as its the first item in the PATH Environment Variable. What you are better of doing is download PHP5.2.x zip package and extract the contents of it to C:/php. Then Download the zip package for PHP5.3 and extract it to C:/php5.3. Add ONLY C:/php to your PATH. Now add the following to Apaches httpd config. LoadModule php5_module "C:/php/php5apache2_2.dll" AddType application/x-httpd-php .php .phtml .php3 PHPIniDir "C:/php" When you start Apache it will be using PHP5.2. To swap versions simply stop Apache and rename C:/php to C:/php5.2 and C:/php5.3 to C:/php. When you start Apache it should be using PHP5.3. To go back to PHP5.2 just rename the folders again. Pain in the arse but it should work. Quote Link to comment https://forums.phpfreaks.com/topic/165738-difficulty-switching-between-php-52x-and-php-53-on-apache/#findComment-874625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.