I am using xampp for deploying web apps. It includes the PHP module in a package. Now what I want to do is change the default path to PHP so that I can make use of other versions of PHP without overwriting the existing module. My new copy of PHP exists on the desktop. How can I configure Apache to refer to the PHP module present on the desktop, rather than the default one?
Asked
Active
Viewed 2.3k times
10
-
1I know your question asks about XAMPP, but Softaculous AMPPS has a built-in interface that allows you to switch between PHP versions. This question is possibly a duplicate of https://superuser.com/questions/123902/getting-xampp-to-work-with-multiple-version-of-php – Agi Hammerthief Apr 12 '14 at 11:31
-
possible duplicate of [Using XAMPP, how do i swap out PHP 5.3 for PHP 5.2?](http://stackoverflow.com/questions/1302168/using-xampp-how-do-i-swap-out-php-5-3-for-php-5-2) – Agi Hammerthief Apr 12 '14 at 11:34
1 Answers
11
- Download your desired version of the PHP thread-safe binary (zipped) from http://windows.php.net/download/.
- Unzip the downloaded version of the PHP in a separate directory. Please make sure that your new php directory's name is not "PHP". (For example, use
php54
for PHP 5.4) - Copy the new PHP directory into your XAMPP directory. (DO NOT overwrite your existing
php
directory!) - Now go to your xampp/apache/conf/extra directory. Make a backup of, then open the
httpd-xampp.conf
file. Change the following variables/directives:
PHPINIDir
to be[your xampp folder]/[new version of PHP]
LoadModule
to be[your xampp folder]/[new version of PHP]/php5apache2_2.dll
Save the
httpd-xampp.conf
file. Restart your XAMPP apache server. If your server get restarted successfully, then your server's PHP version was upgraded. You can check the status of your PHP version by using the URL[localhost][:port]/xampp/phpinfo.php
.
If you are still having issues, try this as well:
Change the LoadFile "[xammp folder]/php/php5ts.dll"
directive to LoadFile "[xampp folder]/php54/php5ts.dll"
Source : http://www.techflirt.com/how-to-upgrade-php-in-xampp/

Agi Hammerthief
- 2,114
- 1
- 22
- 38
-
I run xampp on solaris there's no httpd-xampp.conf file nor PHPINIDir variable in any file – Ben Dec 21 '22 at 19:26