How to update PHP version in Xampp

Your search for the Xampp tutorial has finally got an end. As in this blog post of how to update php version in Xampp, we will make you come across the learning’s you were looking for. We understand it requires a lot of time to use multiple versions of php for your various projects. In this situation, sometimes you end up with installing xampp on different port or you can install one xampp and update php. Through this blog post, you will come across how you can update php version in xampp. Follow the steps listed below to update php in your xampp server.

  1. Download PHPIf you are using xampp, it simply means you are using windows system. So, firstly you need to download the required version of php binary.

You can download from here- www.

Be cautious while choosing binary. If you are currently using XAMPP then your web server is Apache. So, it is advisable to download thread safe binary. The recommendations are to download the zip version.

  1. Configuration- Configure your new php version with your xampp. Unzip the downloaded version of the PHP in a different and split folder. Also, keep this in mind your new php folder should not have “PHP” in the folder’s name. Otherwise you can use folder name as the version name. Example, for php5.5 you can use php55. Now copy the new php folder with a command (ctrl+c) and paste (ctrl+v) it into the xampp folder. Now head over to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. It’s time to change the variables:
  • Variable PHPINIDir to be <your xampp folder>/<new version of PHP>
  • Variable 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 gets restarted successfully then your server php version is upgraded. You can confirm the status of your php version by URL http://localhost/xampp/phpinfo.php.  

Above were the steps how you can make your updates on windows. But, what if you want to update php version to mac, you can take use of Homebrew or otherwise PHP OSX.

Now, let’s have a look at the apache php module. When php is used as an apache module it inherits apache’s user permissions i.e. typically those of the “nobody” user. This has several affects on security and authorization. Let’s take an example, if you are using php to access a database, if the database has built-in access control, you need to make the database easy to get to the “nobody” user. This signifies that a malicious script could access and adapt the database, even without the help of a username and password. There are chances that a web spider could stumble across a database administrator’s web page, and interrupts all your databases. This can be protected against with apache authorization, or you can simply design your own access model with the help of .htaccess files, LDAP, etc and involve that code as part of your PHP scripts.

Related posts