Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using XAMPP, how do I swap out PHP 5.3 for PHP 5.2?

I'm using XAMPP 1.7.2, but need to swap out PHP 5.3 for PHP 5.2 - how do I do this?

like image 839
jskoyles Avatar asked Aug 19 '09 19:08

jskoyles


People also ask

How do I upgrade or downgrade PHP version in xampp?

To do the downgrade you need just to download php 5.3 from http://php.net/releases/ (zip archive), than go to xampp folder and copy subfolder "php" to e.g. php5. 5 (just for backup). Than remove content of the folder php and unzip content of zip archive downloaded from php.net.

Does PHP get installed with xampp?

XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl.


2 Answers

Thanks for the answer. I just got this working on Windows XP, with a few modifications. Here are my steps.

  1. Download and install latest xampp to G:\xampp. As of 2010/03/12, this is 1.7.3.
  2. Download the zip of xampp-win32-1.7.0.zip, which is the latest xampp distro without php 5.3. Extract somewhere, e.g. G:\xampp-win32-1.7.0\
  3. Remove directory G:\xampp\php
  4. Remove G:\xampp\apache\modules\php5apache2_2.dll and php5apache2_2_filter.dll
  5. Copy G:\xampp-win32-1.7.0\xampp\php to G:\xampp\php.
  6. Copy G:\xampp-win32-1.7.0\xampp\apache\bin\php* to G:\xampp\apache\bin
  7. Edit G:\xampp\apache\conf\extra\httpd-xampp.conf.
    • Immediately after the line, <IfModule alias_module> add the lines

(snip)

<IfModule mime_module>   LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"   AddType application/x-httpd-php-source .phps   AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt     <Directory "/xampp/htdocs/xampp">       <IfModule php5_module>         <Files "status.php">             php_admin_flag safe_mode off         </Files>       </IfModule>     </Directory> </IfModule> 

(Note that this is taken from the same file in the 1.7.0 xampp distribution. If you run into trouble, check that conf file and make the new one match it.)

You should then be able to start the apache server with PHP 5.2.8. You can tail the G:\xampp\apache\logs\error.log file to see whether there are any errors on startup. If not, you should be able to see the XAMPP splash screen when you navigate to localhost.

Hope this helps the next guy.

cheers,

Jake

like image 108
Jake Avatar answered Sep 19 '22 18:09

Jake


I know this doesn't help you, but I have to say that this is one of the reasons I jumped from XAMPP to WampServer. WampServer lets you install multiple versions of PHP, Apache and/or MySQL, and switch between them all via a menu option.

like image 35
Narcissus Avatar answered Sep 20 '22 18:09

Narcissus