How to upgrade to latest php version in xampp from 5.3 to PHP Version 5.6.23
How to upgrade to new php version in xampp from 5.3 to PHP Version 5.6.23?
When we are using xampp for Website development with PHP and Apache server. Some times need arise to upgrade the php to latest version. This helps in saving time for installing softwares from startup.
- Backup your xampp current folder and data folder/Scripts folder before upgrade. Any issues in upgrade can destroy your work.
- Download PHP Version (x) : Download the version of php to which you want to upgrade from here http://windows.php.net/download/. Unzip the folder and give it name. Its your choice to name it php-x.x version or any other name But please dont give “php” to it. As, in xampp current installation there is already a folder named “php”.
- Stop your xampp server i.e. MySQL , Apache or any other server if you are running.
- Now go to yourxamppdirectory/apache/conf/extra folder. Inside extra folder Open file httpd-xampp.conf . I am using the same values which are on my system to avoid any confusions. My xampp directory is c:\xampp1. Change the following variables:
Variables with old values
LoadFile “C:/xampp1/php/php5ts.dll”
LoadFile “C:/xampp1/php/libpq.dll”
LoadModule php5_module “C:/xampp1/php/php5apache2_4.dll”
PHPINIDir “C:/xampp1/php”
ScriptAlias /php-cgi/ “C:/xampp1/php/”
<Directory “C:/xampp1/php”>
——
—–
</Directory>
Variables with new values
LoadFile “C:/xampp1/php-5.6.23/php5ts.dll”
LoadFile “C:/xampp1/php-5.6.23/libpq.dll”
LoadModule php5_module “C:/xampp1/php-5.6.23/php5apache2_4.dll”
PHPINIDir “C:/xampp1/php-5.6.23”
ScriptAlias /php-cgi/ “C:/xampp1/php-5.6.23/”
<Directory “C:/xampp1/php-5.6.23”>
———-
</Directory>
Now restart your xampp server. It will work now.
Run phpinfo() command from file and see new version in it.
Issues faced while doing ugrade.
After starting xampp server, I found below error :
Issues 1 :
Fatal error: Call to undefined function mb_detect_encoding() in yourxamppdirectory\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177
Solution is :
- Stop xampp.
- There is no php.ini file in new folder i.e. So, i copied php.ini-development and rename it to php.ini (the php configuration file).
- I googled the issue and done below changes i.e. edit php.ini (the php configuration file), Now my MySQL, Apache server and PHP is working. Look for
OLD values
; On windows:
extension_dir=”ext”
New values
; On windows:
extension_dir=”C:\xampp1\php-5.6.23\ext”
Remove semi colon from below extension o enable dll’s.
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
Restart your xampp server.
Restart xampp and hopefully it’ll work.
Please share your views in comments.
Thanks.