Wampserver 2.2 and PHP 5.4.4
Posted by: BiancaBrowne (---.access.mtnbusiness.co.za)
Date: July 16, 2013 02:31PM

Hi there

I currently have WampServer 2.2 (with PHP 5.3.13) installed on my local machine. My hosting provider has upgraded to PHP 5.4.4 so i need to do the same. I looked at www.wampserver.com for a PHP addon but the latest I could find was 5.3.1 under the PHP addons section.

I am new to wampserver and php so please forgive me if the answer is very obvious but please can someone advise me on the steps i need to take to upgrade my PHP version to 5.4.4?

Thanks
Bianca

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: RiggsFolly (---.as13285.net)
Date: July 16, 2013 05:58PM

Bianca,

You may not like this, but to get to php5.4.4 you will need to do it manually.

Here is my HowTo. I hope its of some use.



Before you start

On Apache and PHP you will see the acronym VC6 and VC9. This denotes the compiler version used to compile that program or dll. It stands for Visual C V6 or Visual C V9.
Unfortunately you cannot mix the two when it comes to Apache and PHP.
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.

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 www.php.net/download
You should use the Thread Safe build.
Make sure its built with the same compiler versions as you Apache ( VC6 or VC9 )

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

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.

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.

It should look something like this:


7. We must now make some change to the php.ini files to WAMPise them.
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.

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]

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 phpForApache.ini with this new one and move over anything you believe is relevant.



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 stop Apache ( the icon will go Orange )
Copy the correct files from the PHP folder to the Apache folder
php5apachex_y.dll, the php interpreter dll used by Apache
phpForApache.ini the php config file
etc

And then 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 or VC9 ) 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.
Remeber the version you load will depend upon which MAJOR version of PHP you are using i.e. 5.2,5.3 or 5.4

;ioncube Extension
zend_extension = "c:/webstuff/ioncube/vc9/ioncube_loader_win_5.3.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"

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: BiancaBrowne (---.access.mtnbusiness.co.za)
Date: July 17, 2013 04:52PM

Hi RiggsFolly

Wow! Thank you sooooooooooooo much for the detailed explanation of what to do. I really appreciate the time and effort you have put into the answer. I will give it a try and let you know.

I am not quite sure how to check my current Apache compiler version but I saw that my current PHP is VC9 (by clicking on phpinfo() under tools on the wamp server home page) so would i be correct in assuming my current Apache is VC9 if currently everything is working fine?

Thanks
Bianca

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: RiggsFolly (---.as13285.net)
Date: July 17, 2013 06:30PM

Yes, Apache and PHP have to be compiled with the same compiler, so if it works then Apache is VC9 also.

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: BiancaBrowne (---.access.mtnbusiness.co.za)
Date: July 18, 2013 02:55PM

Hi RiggsFolly

I'd just like to let you know that all went perfectly! THANK YOU. I now have a working version of PHP 5.4.17 under WampServer2.2. Thank you so much for your detailed notes and the technical explanations behind why certain things were needed. I really appreciate the assistence!

many thanks
Bianca

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: RiggsFolly (---.as13285.net)
Date: July 18, 2013 03:13PM

Your welcome.

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: Deleu (---.115.67.101.static.gvt.net.br)
Date: November 11, 2014 12:22AM

Hi,

I know this is an old topic, but it regards the problem I'm facing.

My setup:
Windows 8.1 x64
WampServer 2.2
PHP 5.3.8
Apache 2.2.21

After following this tutorial, I successfully managed to add:
PHP 5.6.2
Apache 2.4.10

Now I only need one more thing:
My "homepage" when using Apache 2.4 and PHP 5.6 is the default home page from Apache.
I would like to be able to see the WampServer home page even when using the new setup.

Thanks in advance.

Options: ReplyQuote
Re: Wampserver 2.2 and PHP 5.4.4
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: November 11, 2014 02:16AM

Then you have not followed the tutorial completely.

Check the section on editing the httpd.conf file to Wamperise it.

---------------------------------------------------------------------------------------------
(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


Sorry, only registered users may post in this forum.