Migration to PHP 5.6
Posted by: MacNala (---.15-1.cable.virginm.net)
Date: October 27, 2014 10:03AM

I have noted that PHP have released PHP 5.6.2.
How do you upgrade WampServer from 5.5.12 to 5.6.2?
I am interested in that PHP 5.6 contains a method to debug PHP code interactively. phpdbg

Win 10 Prof 64 bit
in a Windows 10 Prof virtual machine 64 bit

WAMP server v 3.0.6 64 bit
Apache v 2.4.23
PHP v 5.6.27
MySQL v 5.7.16
WAMP manager is GREEN
127.0.0.1 localhost
::1 localhost



Edited 1 time(s). Last edit at 10/27/2014 10:04AM by MacNala.

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 27, 2014 10:27AM

If you notice All WAMPServers have come with XDEBUG for many releases.

You can use XDEBUG from tools like NetBeans and Eclipse PDT and other tools as well.


You can manually install any version of PHP that you can find, here is how, this is not based on adding PHP5.6.2 but I hope you can follow the basic principals.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 27, 2014 10:27AM

HOW TO MANUALLY INSTALL A NEW RELEASE OF PHP INTO THE WAMP ENVIRONMENT

Before you start

On Apache and PHP you will see the acronyms VC6, VC9, VC10 or VC11. This denotes the compiler version used to compile that program or dll.
Unfortunately you cannot mix the two when it comes to Apache and PHP as it is configured in WAMPServer, although some docuentation suggestst that VC10 and VC11 are compatible with each other, I make no guarantee of this.
So first you must find out which compiler was used to compile the Apache you are currently using, so you can get the PHP that was compiled with the same version of the compiler.
As time goes on this becomes more complicated as newer versions of PHP are not being compiled and linked with older versions of the compilers. VC6 seems to have been dropped a little while ago. So if you want to use a new PHP you will probably have to upgrade your version of Apache as well so you have a version that is compiled with at least VC9



The way PHP and Apache interact in the default WAMPServer install is that Apache launches the PHP Interpereter as a dll (php5apachex_y.dll) as this is a very close relationship i.e. not communication via a TCP port like PHP and MySQL, so they both have to have been compiled using the same version of Microsoft Visual C Compiler.


1. From WampManager "Stop All Services".

2. Download the PHP Release you want to install from HERE or if its not a current release from The Acrhives
You should use the Thread Safe build. Usually the Not Thread Safe version has the acronim NTS and the thread safe version does not.
You should download the ZIP and not an .msi
Make sure its built with the same compiler versions as you Apache ( VC6 / VC9 / VC10 / VC11 ),
yes its a mine field. But if you are using WAMPServer 2.4 or > then you want the VC11 Thread Safe version.

3. Create a new folder under c:\wamp\bin\php\ with the name = the version you are installing
So, for example, make a folder called php5.5.11.



4. Now from the folder containing your most recent ( and working ) verions of PHP copy the file called wampserver.conf and paste it into your new PHP folder created in the previous setp.
This file is required by wamp server to properly identify that this is a valid PHP version folder.
The file contains references to the names of the dll files that contain the PHP interpreter, so that the correct file can be copied to the Apache folder when you activate this new version of the PHP interpreter.

The file should look like this, if you are moving from a very old version of PHP you may need to add some new sections from here to your file.

<?php

$phpConf['phpIniDir'] = '.';
$phpConf['phpExeDir'] = '.';
$phpConf['phpConfFile'] = 'php.ini';


$phpConf['apache']['2.2']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.2']['LoadModuleFile'] = 'php5apache2_2.dll';
$phpConf['apache']['2.2']['AddModule'] =  '';

$phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] =  '';

?>


5. Now unzip the downloaded PHP into your new folder, make sure the folder hierarchy looks like this.





6. Now in your new folder copy the file php.ini_development into a new file called php.ini


Do the same again but paste into a file called phpForApache.ini
You should now have the original file called php.ini_development PLUS 2 more, one called php.ini and one called phpForApache.ini

The php.ini file is used if you are using the PHP CLI i.e. running php from the command line > php script.php
The phpForApache.ini is the php config used by Apache. This file is copied into the currently active Apache's folder and renamed to php.ini by WAMPmaneger when you activate this version of PHP.




7. We must now make some change to the php.ini files to WAMPise them. Take your time here it will save you time later.

Edit the newly created phpForApache.ini file

Search for extension_dir and change to
extension_dir = "d:/wamp/bin/php/phpx.y.z/ext/" <- where x,y,z match the folder you are putting the new PHP into.

Search for ;error_log = php_errors.log and change to
error_log = c:\wamp\logs\php_errors.log
Search for anything 'php/' and make sure you change it to you c:\wamp\bin\php\php.x.y.z folder name.

In fact search for anything with a C:\ in it and make sure its chnaged to the WAMPServer equivalent.

As of PHP5.4 the timezone need to be set
Search for [Date] and put an entry into the date.timezone field as a minimum

date.timezone = "Europe/London"
date.default_latitude = 0.0
date.default_longitude = 51.502973

look here for a list of supported timezone values [www.php.net]

PHP5.5 specific changes
a. All the PHP extensions are commented out, so you need to manually uncomment at least some of them
Check your last used php.ini to see what you need, remember some extensions may have been included in the core of php so you may need to check the php change log for details.


Now there may well be other configuration changes you had made to your existing PHP, these you will have to find and transfer yourself.
I suggest you compare your last \wamp\bin\apache\apachex.y.z\bin\php.ini with this new one and move over anything you believe is relevant.


DONT FORGET, if you are using the PHP CLI you will also need to do this to the php.ini file as well.

8. Make sure all services are stopped in wampmanager, and then right click over the wamp manager icon in the system tray and select the 'refresh' menu item.
When you left click on wamp manager -> PHP -> Version you should see your new version in the list.

If the new version does not appear, then you have probably spelt the phpForApache.ini file name wrong. Correct it and redo the 'refresh'.

9. You can now 'restart all services' from the wamp manager menus.

NOTE: You have not actually changed anything yet, so if wamp,Apache,PHP etc were working before they still should be.

10. Activate your new PHP version.
Using the wamp manager menus again you just need to click on the new version number to activate it.
wamp manager -> PHP -> Version -> 5.5.11 ( <- or whatever the version number is you have just added )

This will cause wamp manager to :-
1. Stop Apache ( the icon will go Orange )
2. Copy the correct files from the PHP folder to the Apache folder or if you are on WAMPServer 2.5 or greater
create the correct SYMLINK in the apachex.y.z/bin folder.
3. Restart Apache. So the wamp manager icon should go GREEN again.

If the wamp manager icon stays ORANGE, then you have missed something, probably a file name spelt wrong. The phpForApache.ini file must exists.

11. Now run localhost from the wamp manager menu, and check the wamp server home page. It should tell you which version of PHP is loaded.





TROUBLE SHOOTING
If it all goes wrong when you activate the new PHP, you can easily back out of trouble by just activating whatever version of PHP you were using before, and then going back to see what you did wrong.


ADDING IONCUBE

You must ensure that you download the correct version to match your PHP :-
compiler( VC6/VC9/VC11 etc ) compiled ionCube dll
correct 32 or 64 bit code
and the Thread Safe version which is the one that is not NON-TS


1. Download the correct ionCube loader from [www.ioncube.com]
2. Place it somewhere on your disk, but not in the WAMP folder.
for example c:\webstuff\ioncube\vc9\
2. Edit the new php.ini Using the wamp manager menus
Add these 2 lines at the bottom of the file.
Remember the version you load will depend upon which MAJOR version of PHP you are using i.e. 5.2,5.3 or 5.4

NOTE on IONCUBE and PHP5.5
Ioncube for PHP5.5 is not yet released as of 13/09/2013, they say they are waiting for PHP 5.5 to become stable and secure and hosting providers to adopt PHP 5.5 before they release their upgrade. They comment that it can take a year or more for hosting companies to adopt new versions of PHP and this I guess is their schedule.



;ioncube Extension
zend_extension = "c:/webstuff/ioncube/vc9/ioncube_loader_win_5.5.dll"



ADDING XDEBUG
XDEBUG comes with WAMP Server and is incredibly useful for debugging CLI or WEB scripts.
But it does not come with the PHP you have downloaded from the PHP website.
When upgrading PHP to a major version release you may need to get an up to date version of xdebug from
http://xdebug.org/download.php
For a minor version upgrade you can probably use the existing xdebug version you already have on disk.

So for a minor PHP version upgrade, copy the folder c:\wamp\bin\php\php5.y.z\zend_ext from your old PHP to your new php folder.
For a major PHP version upgrade get a new dll from the xdebug website and put it in a newly created folder called c:\wamp\bin\php\php5.y.z\zend_ext

Now add a line like this ( version specific of course ) to your php.ini ( using the wamp manager menus, to ensure you are editing the correct file )

;XDEBUG Extension
zend_extension = "d:/wamp/bin/php/phpx.y.z/zend_ext/php_xdebug-2.2.2-5.3-vc9.dll"

[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "d:/wamp/tmp"

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 08/17/2016 07:38PM by RiggsFolly.

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: MacNala (---.15-1.cable.virginm.net)
Date: October 27, 2014 09:42PM

Thanks a lot for the very detailed steps for each of the upgrades.
A very useful primer.

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: goofan (---.bredband.comhem.se)
Date: April 11, 2015 12:30AM

Hello,

So I just went through the steps and I got the Version showing.

However my fault lies in the extensions or so I think as my phpinfo() doesn't show that the Mysqli PDO driver been loaded nor has the sqllite.

I have activated the extensions in the php.ini:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.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
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
extension=php_shmop.dll

And my entension dir is like this:
; Directory in which the loadable extensions (modules) reside.
; [php.net]
; extension_dir = "./"
; On windows:
extension_dir = "C:\wamp\bin\php\php5.6.7\ext\"

I have been over the old php.ini from 5.5.12 and I can't find what is wrong.

Error I get:
could not find driver

Regards,
Thomas
P.S. Thanks in advance D.S.

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.as43234.net)
Date: April 11, 2015 10:14AM

Maybe you edited the wrong php.ini file.

Apache uses the \wamp\bin\php\php5.6.x\phpForApacke.ini file

The best way to edit the right file for apache is ti use the wampmanager menus

Make sure the correct PHP is activated first then

- wampmanager-> PHP -> php.ini

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: goofan (---.bredband.comhem.se)
Date: April 11, 2015 12:28PM

Hi RiggsFolly.

the File I have been editing is just that.

I have been editing it by opening it from the Wamp Menu.

That is not the problem for some reason sad smiley

Thanks tho for a answer

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.as43234.net)
Date: April 11, 2015 11:00PM

Ok, I hope you did not just copy the php.ini settings from your existing php.ini file. Stuff chnages, new bits get added and old stuff gets removed.

Is that what you did?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: nanwich (155.38.128.---)
Date: April 16, 2015 07:13PM

I tried to follow this exactly for 5.6.8 and get
Sorry,

This PHP version doesn't seem to be compatible with your actual Apache Version.
Switch cancelled.
Press ENTER to continue...

Apache 2.4.4
Wampserver 2.4

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.as43234.net)
Date: April 16, 2015 09:13PM

Please start you own thread.

Start all question with the answers to these questions [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: SuperStromboli (---.phlapa.fios.verizon.net)
Date: August 13, 2015 04:55AM

*UPDATE* After consulting another tutorial for install, the one thing I seemed to be missing was updating my Windows Path to change the version of PHP to the new one. Then everything started working like a charm. I knew I was so close to getting it working, but I didn't know I was that close. Hope this helps someone.


I've hit the same wall trying to upgrade to php 5.6.12 because I wanted to use Laravel 5. I can't switch back to php 5.4.12 due to the same error, so now I'm locked out of all my local dev projects.

Extremely frustrating.



Edited 1 time(s). Last edit at 08/13/2015 05:33AM by SuperStromboli.

Options: ReplyQuote
Re: Migration to PHP 5.6
Posted by: RiggsFolly (---.as43234.net)
Date: August 13, 2015 10:30AM

You should not put anything to do with WAMPserver into the Windows PATH under any circumstances, for the obvious reason that when you switch versions of, for example PHP then the system is pointing at the wrong folders.

Instead create yourself a .cmd batch file, pleace that in a folder that is already on the Windows PATH so you can run it from anywhere. Here is an example of what I use, that works very well for me

File called phppath.cmd


echo off
if %1.==. GOTO THEDEFAULT
ECHO Setting up PHP%1
PATH=%PATH%;d:\wamp\bin\php\php%1
REM ONLY UNCOMMENT THESE LINES IF YOU HAVE INSTALLED PEAR ON YOUR SYSTEM
REM set PHP_PEAR_SYSCONF_DIR=D:\wamp\bin\php\php%1
REM set PHP_PEAR_INSTALL_DIR=D:\wamp\bin\php\php%1\pear
REM set PHP_PEAR_DOC_DIR=D:\wamp\bin\php\php%1\docs
REM set PHP_PEAR_BIN_DIR=D:\wamp\bin\php\php%1
REM set PHP_PEAR_DATA_DIR=D:\wamp\bin\php\php%1\data
REM set PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php%1\php.exe
REM set PHP_PEAR_TEST_DIR=D:\wamp\bin\php\php%1\tests
echo ---------------------------------------------------------------
php -v
echo ---------------------------------------------------------------
GOTO COMPOSER

:THEDEFAULT
echo Taking the default version php5.5.12
echo .
PATH=%PATH%;d:\wamp\bin\php\php5.5.12
REM set PHP_PEAR_SYSCONF_DIR=D:\wamp\bin\php\php5.5.12
REM set PHP_PEAR_INSTALL_DIR=D:\wamp\bin\php\php5.5.12\pear
REM set PHP_PEAR_DOC_DIR=D:\wamp\bin\php\php5.5.12\docs
REM set PHP_PEAR_BIN_DIR=D:\wamp\bin\php\php5.5.12
REM set PHP_PEAR_DATA_DIR=D:\wamp\bin\php\php5.5.12\data
REM set PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php5.5.12\php.exe
REM set PHP_PEAR_TEST_DIR=D:\wamp\bin\php\php5.5.12\tests
echo ---------------------------------------------------------------
php -v
echo ---------------------------------------------------------------

:COMPOSER
echo Make Composer work
PATH=%PATH%;D:\wamp\composer
echo ---------UPDATE COMPOSER---------------------------------------
composer self-update

You can of course add anthing else specific to your requirements

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 08/13/2015 10:32AM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.