[ratings]Lots of time you need to use multiple version of php for your different project. In this case either you want to install xampp on different port or you can install one xampp and upgrade php. In this article I will demonstrate how you can upgrade php in your xampp server. I will demonstrate the complete process by adding PHP 5.4 with XAMPP. Following is the step by step process of upgrading php in your xampp server. Before trying these steps please take complete backup of your code and database alognwith xampp because any small mistake can lead to the corruption of your regular XAMPP.
Upgrade PHP in XAMPP server
1) Download PHP : If you are using xampp ofcourse you are using windows operating system. So first download your desired version of php binary from http://windows.php.net/download/ website. Be careful while choosing binary. If you are using XAMPP then your webserver is apache. So always download Thread Safe binary. Also read the compiler suggestion carefully on the windows.php.net site. I will recommend to download zip version.
2) Configure New PHP Version with your xampp: Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not “PHP”. May be you can use filder name as the version name. For example for php 5.4 you can use php54. Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:
- Variable PHPINIDir to be <your xampp folder>/<new version of PHP>
- Varaible LoadModule to be <your xampp folder>/<new version of PHP>/php5apache2_2.dll
Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded. You can check the status of your php version by URL http://localhost/xampp/phpinfo.php .