Tektriks

Coding starts here
Home / Blog

How to upgrade php 5.6 to php 7 in XAMPP on Windows

PHP 7.0.0 is released on 3rd Dec. 2015. It comes with more strong features which I listing below –

  • PHP 7 is almost twice as fast as PHP 5.6
  • Low memory usage
  • Introducing null coalescing & Spaceship operator
  • Scalar & Return type declarations
  • Session start with options
  • Anonymous classes and much more.

Find more on at http://php.net/manual/en/migration70.php

As a dedicated PHP developer, you should upgrade or make hands dirty with the new version of php. If you struggled with installing the latest version in XAMPP on your Windows 7, 8 or 10 machine, then you come at right place.

First download latest PHP version from http://windows.php.net/download#php-7.0. Download the VC14 x86 Thread Safe or VC14 x64 Thread Safe deciding upon your Windows version( x86 for 32-bit and x64 for 64-bit ). Next extract the zip file in a folder named php.

Go to your XAMPP installation directory and rename your old php directory with old version prefix like php to php_5_6_14. Now copy & paste the extracted new php folder to here.

Next, open httpd-xampp.conf from XAMPP configuration.
xampp
On PHP-Module setup section, comment these two lines and add the two lines below
#
# PHP-Module setup
#
#LoadFile "D:/xampp/php/php5ts.dll"
#LoadModule php5_module "D:/xampp/php/php5apache2_4.dll"
LoadFile "D:/xampp/php/php7ts.dll"
LoadModule php7_module "D:/xampp/php/php7apache2_4.dll"

That’s it. Restart your XAMPP server and keep coding.
localhost

Photo credit: fullo via VisualHunt.com / CC BY-NC-SA

Leave a Reply

32 Comments on "How to upgrade php 5.6 to php 7 in XAMPP on Windows"

Notify of
avatar
Sort by:   newest | oldest | most voted
garima
Guest

PHP7 updated successfully but in phpmyadmin below metioned error is coming .
Please help . I am using xampp with version 3.2.1
Deprecation Notice in .librariesphp-gettextstreams.php#48
Methods with the same name as their class will not be constructors in a future version of PHP; StringReader has a deprecated constructor

Backtrace

.librariesphp-gettextgettext.inc#41: require()
.librariesselect_lang.lib.php#471: require_once(.librariesphp-gettextgettext.inc)
.librariescommon.inc.php#564: require(.librariesselect_lang.lib.php)
.error_report.php#8: require_once(.librariescommon.inc.php)

Brian Emilius
Guest
I followed this guide and it works perfectly, except for PDO. I used the php.ini-development file as my php.ini and uncommented the extention folder line, as well as the relevant PDO drivers (php_pdo_mysql.php), and I verified that the dll files are in the ext folder. I also ran php -m in console, and both PDO and pdo_mysql are loaded modules. Yet, I cannot get any PDO scripts to work. The error I get thrown is “Fatal error: Uncaught PDOException: could not find driver in C:xampphtdocspathtoscript.php(19)” Where line 19 is a simple $dbh = new PDO(mysql params); What am I missing?… Read more »
aspokes
Guest

i faced the same problem. Its the ini file that’s not loaded. To solve, open your httpd-xampp.conf file.
Look for
Change to
Restart apache.
It should work now. You can run this
echo $inipath = php_ini_loaded_file();
This will display the path if its loaded.

Joshua.
Guest

Hi, Can you change the slashes to forward slashes?
e.g. “C:xampphtdocspathtoscript.php”
to C:/xampp/htdocs/path/to/script.php”

LukasKane
Guest

Thx, it works

Kalle
Guest

I dont like WAMP. This has PHP 7.0.12 included and is simpler to install: https://www.mwiede.de/windows-php-webserver/

wpDiscuz