I'm using XAMPP 1.7.2, but need to swap out PHP 5.3 for PHP 5.2 - how do I do this?
You can download older versions of XAMPP here. PHP 5.3 was added in version 1.7.2, so anything older would be good.
You'll have to uninstall XAMPP 1.7.2 and install XAMPP 1.7.0, which contains PHP 5.2.8.
D:\Documents and Settings\box>php -v
PHP 5.2.8 (cli) (built: Dec 8 2008 19:31:23)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technol
ogies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
XAMPP 1.6.8 contains PHP 5.2.6.
D:\Documents and Settings\box>php -v
PHP 5.2.6 (cli) (built: May 2 2008 18:02:07)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technol
ogies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
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.
- Stop your Apache server from running.
- Download the most recent version of XAMPP that contains a release of PHP 5.2.* from the SourceForge site linked at the apachefriends website.
- Rename the PHP file in your current installation (MAC OSX: /xamppfiles/modules/libphp.so) to something else (just in case).
- Copy the PHP file located in the same directory tree from the older XAMPP installation that you just downloaded, and place it in the directory of the file you just renamed.
- Start the Apache server, and generate a fresh version of phpinfo().
- Once you confirm that the PHP version has been lowered, delete the remaining files from the older XAMPP install.
- Fun esues.
I just confirmed that this works when using a version of PHP 5.2.9 from XAMPP for OS X 1.0.1 (April 2009), and surgically moving it to XAMPP for OS X 1.7.2 (August 2009).
I can't answers this either, however i have tried daniel's suggestion and for me then curl
didn't work anymore. :-(((
If you use Windows, you can use WAMP instead. It lets you run multiple versions of PHP, Apache, and MySQL on the same installation. You can easily swap between versions from the UI. I used to be a XAMPP user but I switched to WAMP.
Thanks for the answer. I just got this working on Windows XP, with a few modifications. Here are my steps.
- Download and install latest xampp to G:\xampp. As of 2010/03/12, this is 1.7.3.
- 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\
- Remove directory G:\xampp\php
- Remove G:\xampp\apache\modules\php5apache2_2.dll and php5apache2_2_filter.dll
- Copy G:\xampp-win32-1.7.0\xampp\php to G:\xampp\php.
- Copy G:\xampp-win32-1.7.0\xampp\apache\bin\php* to G:\xampp\apache\bin
- 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
For OSX it's even easier. Your machine should come with a version of Apache already installed. All you need to do is locate the php lib for that version (which is likely 5.2.x) and swap it out.
This is the command you'd run from terminal*
cp /usr/libexec/apache2/libphp5.so /Applications/XAMPP/xamppfiles/modules/libphp5.so
I tested this on 10.5 (Leopard), so ymmv. * all the caveats about this might break your system, make a backup, blah blah blah.
Jake's suggestion worked for me, perfectly.
I did follow Daniel's instruction to not delete the files before being sure, though. That's good strategy to follow.
Jake's solution worked, BUT!!! Needed to change the path of the php5_module to load in http-xampp.conf: from: LoadModule php5_module modules/php5apache2_2.dll
To: LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"
After that it worked. Cheers!