Pages: Previous12
Current Page: 2 of 2
Re: How to downgrade PHP on WAMP?
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: September 25, 2011 05:02PM

No there isnt, and they wont be. - its not possibblle to make 5.2.x in 64bit

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: rodiusd (---.106.100.87.rev.sfr.net)
Date: September 29, 2011 12:06PM

Thanks for the reply.

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: trigem (---.3-87-r.retail.telecomitalia.it)
Date: March 13, 2012 11:23AM

I confirm the last posts: I found no way to run PHP 5.2.x with WAMP in 64bit. After installing the 32 bit version PHP 5.2 run correctly.

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: panique (---.dynamic.primacom.net)
Date: June 12, 2012 08:30PM

copy that ! After strugglin around with this for several days i also found out it's the 32bit version vs. 64bit version thing ! Using a 32bit version will fix your problems.

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: Pri (117.201.179.---)
Date: September 05, 2012 10:38AM

Could anyone plz tell dt how to upgrade the default version of php in wamp which is 5.3.13 to php 5.3.2..

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: stevenmartin99 (Moderator)
Date: September 05, 2012 11:13AM

You don't need to reinstall the 32bit wamp, you just need to install an apache Addon as well as the php Addon

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: zorro99 (---.151.15.gbely.net)
Date: June 05, 2013 09:19PM

I have Windows 7 64 bit version.
I'm trying to downgrade PHP to version 5.1, what versions of MySQL and Apache I have to install to run correctly?

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: RiggsFolly (---.as13285.net)
Date: June 06, 2013 01:59AM

Click on the ADDONS link on the wampserver main page, APache ADDONS.

Look at the compatibility table, take your pick.

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: TBotNik (64.123.184.---)
Date: June 16, 2014 03:55PM

All,

Downloaded and installed current WAMP version, which include PHP 5.5.12, but we are running MS-SQL on our apps and so far there is no MS-SQL support for 5.5.x, so downloaded PHP 5.4.29 and installed.

Need to know how to switch to this version.

WAMP is installed to:

C:\Program Files\Wamp

PHP 5.5.12 is at:


C:\Program Files\Wamp\bin\php\php5.5.12


I installed PHP 5.4.29 to:


C:\Program Files\Wamp\bin\php\php5.4


I commented out these lines in the apache httpd.conf file:


LoadModule php5_module "c:/Program Files/Wamp/bin/php/php5.5.12/php5apache2_4.dll"
PHPIniDir c:/Program Files/Wamp/bin/php/php5.5.12


Copied the php5apache2.dll to my php5.4 dir and add these line to the httpd.conf

LoadModule php5_module "c:/Program Files/Wamp/bin/php/php5.4/php5apache2_4.dll"
PHPIniDir c:/Program Files/Wamp/bin/php/php5.4


But restart did not bring up Apache so looked in the apache and php error logs. Only getting PHP errors saying "Unable to load dynamic library" for both php_intl.dll and php_ldap.dll, but had these in the log with old version, and WAMP ignored them and worked. These errors are lying as the files are there. Not sure why these errors occur.

Therefore reverted to old config, commenting out new lines and uncommenting the old ones.

What is needed for this to work right?

Cheers!

Nyle

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: TBotNik (64.123.184.---)
Date: June 16, 2014 03:56PM

All,

Downloaded and installed current WAMP version, which include PHP 5.5.12, but we are running MS-SQL on our apps and so far there is no MS-SQL support for 5.5.x, so downloaded PHP 5.4.29 and installed.

Need to know how to switch to this version.

WAMP is installed to:

C:\Program Files\Wamp

PHP 5.5.12 is at:


C:\Program Files\Wamp\bin\php\php5.5.12


I installed PHP 5.4.29 to:


C:\Program Files\Wamp\bin\php\php5.4


I commented out these lines in the apache httpd.conf file:


LoadModule php5_module "c:/Program Files/Wamp/bin/php/php5.5.12/php5apache2_4.dll"
PHPIniDir c:/Program Files/Wamp/bin/php/php5.5.12


Copied the php5apache2.dll to my php5.4 dir and add these line to the httpd.conf

LoadModule php5_module "c:/Program Files/Wamp/bin/php/php5.4/php5apache2_4.dll"
PHPIniDir c:/Program Files/Wamp/bin/php/php5.4


But restart did not bring up Apache so looked in the apache and php error logs. Only getting PHP errors saying "Unable to load dynamic library" for both php_intl.dll and php_ldap.dll, but had these in the log with old version, and WAMP ignored them and worked. These errors are lying as the files are there. Not sure why these errors occur.

Therefore reverted to old config, commenting out new lines and uncommenting the old ones.

What is needed for this to work right?

Cheers!

Nyle

Options: ReplyQuote
Re: How to downgrade PHP on WAMP?
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: June 16, 2014 04:36PM

Couple of things Nyle.


1. Its not a good idea installing WAMPServer in a folder that has a space in the folder name i.e. 'Program Files'.
Its better to install into the root directory of C: or D: etc any drive can be used.

2. Wamp has its own mechanism for switching between versions of Apache/PHP/MySQL, you dont need to try and be so clever.



As you want to use PHP 5.4, I see that the 5.4 versions are compiled with VC9. Unfortunately the Apache that comes with WAMPServer 2.5 is compiled with VC11, so you will have to install a version of Apache that is also compiled with VC9.


Following are 2 docs, a little old now, telling you how to manually installed other versions of Apache and PHP. I am sure you can pick the bones out of them to install the version of PHP you are interested in.

It may well be simpler to just install WAMPServer 2.2e as this will come with an Apache compiled with VC9 and then just install the version of PHP you want to use.

But here they are anyway.



HowTo: Install a new version of APACHE into WAMP yourself.


This is not intended to replace the wamp addons mechanism of downloading apache version. If the version you require is available as an addon, use that mechanism, its just so easy.


This tutorial is not really for the absolute beginner. It would help if you had a basic knowledge of how apache/php work together and seperately and their individual configuration, as well as an understanding of what wamp is and does for you.


Read all this document before starting any actual attempt to install an apache version.


This guide assumes you are installing a minor version of an apache you already have installed i.e. apache 2.2.x to apache2.2.y.
I will use the versions 2.2.22 and 2.2.23, the tutorial uses these folder names but of course you will probably be installing different versions.

So here is the process:

1. Download the ZIP version of the Apache you want to run ( not the msi installer, only because I dont know what it may do or assume when it installs )
Suggestion only
[www.apachelounge.com]

2. From wamp manager, Stop all services.

3. Go to c:\wamp\bin\apache\ and create a new folder named appropriately for the release you are installing i.e apache.2.2.23

4. Unzip the Apache downloaded and copy the contents of the unzipped apache folder into your newly created folder in the wamp folder structure. apache2.2.23 in this example.
Make sure the directory levels are the same as your existing apache folder i.e. all the folders get unzipped into a folder called something like apache2, just copy all the subfolders to your new folder wamp\bin\apache\apache.2.2.23 folder. I suggest you unzip it somewhere else and then copy that to the wamp folder.

5. Copy c:\wamp\bin\apache\apache2.2.22\wampserver.conf to c:\wamp\bin\apache\apache2.2.23\wampserver.conf
All the folders in here are relative to where this file lives, so normally nothing need changing in here.
Wamp will not see your new install properly if you forget this step.

6. Now you need to bring your existing httpd.conf file from your current instance of apache.

Be carefull here, things change in the httpd.conf file, parameters get deprecated, new ones get created etc. So use the new httpd.conf as the master and only move over parameters you know you have changed for your actual requirements.

First make a backup of the new wamp\bin\apache\apache2.2.23\httpd.conf as wamp\bin\apache\apache2.2.23\httpd.original.conf ( for example )


Now this new httpd.conf file assumes the location of Apache is the default i.e. c:\apache\....
So there are parameter in YOUR NEW httpd.conf file that MUST BE CHECKED against your old WAMP oriented one
Some but maybe not all are listed here:-

Listen
ServerRoot
ServerAdmin
ServerName
DocumentRoot
<Directory....> Check all the directory parameters match the wamp file structure
ErrorLog
CustomLog
LoadModule
AddType
MimeType
DirectoryIndex Add index.php to this list


Now we must configure apache to use the correct version of PHP.
'LoadModule'
Wamp default is to runs PHP as an apache handler, that means apache loads the PHP interpreter as an apache module. ( see below )
Remember the Apache conf does not assume you are a PHP user so you will have to add this to the new conf file rather than change it.
So you must also check you are loading the correct handler for the version of apache and PHP you want to use.
The PHP folder should contain 1 or more of these handlers ( dll's ) depending on which versions of php it has been compiled for ( not all php version will run with all apache's ).
You must load the correct dll to match the apache version and the php version you want to use.


Ok I am afraid we need a bit of Techy Stuff here.
When PHP is compiled, by cleverer people than us! It is actually compiled more than once for various situations.
If you look in the php/phpx.y.z folder you will see a php.exe, php-win.exe, php-cgi.exe, all of which are irrelivant in the context of this document.

You will also see one or more dll files with names like php5apache2.dll, php5apache2_2.dll, php5apache2_4.dll, again depending on which apache you have download.
These are the php interpreter compiled into a dll for use as an apache handler.
The version of apache that this php is comiled to run with, is denoted by the apache2 (apache 2.0 or 2.1) or apache2_2 (apache 2.2 or 2.3) or apache2_4 ( apache 2.4 ) part of the filename.
The php5 part denotes it is a version of php5 ( but does not tell you which version of php5 ).
The version of php is denoted by the fact that you downloaded php5.3.13 and have luckily loaded it into a folder called php5.3.13 so you know whats what.


If you are using PHP 5.4 with an apache 2.4.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.4.x/php5apache2_4.dll" for using PHP 5.4

If you are using PHP 5.2 or PHP 5.3 with an apache 2.2.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.2.x/php5apache2_2.dll"

If you want to use PHP with an apache 2.0.x or 2.1.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.1.x/php5apache2.dll" for using PHP

NOTE:
This parameter is in the httpd.conf but is loading a file from a PHP folder.

If the php version folder does not contain a handler that matches apache version you want to run then that version of php wont run with that version of apache or your php download has not been compiled for that version of apache, normally the former.

Armed with this information you should be able to find the correct handler for the version of apache and php that you want to run together.


7. If you are using Virtual Servers you will also need to copy the conf\extras\httpd-vhosts.conf file from your old Apache version folder to your new folder.

8. We should be nearly done, so
Right click wampmanager -> refresh

This will tell wamp manager to re-configure itself and go look for anything new in its folder structure i.e. your new apache.
Check it has worked by: left click wampmanager -> Apache -> Versions, you should see your new one appear in the list.

8. Now Left click wamp manager -> Apache -> Versions -> and click your new version numbers to activate the new version of Apache.
This will restart apache and run your new version.

If apache fails to start ( wamp manager stays orange ) either you or I have missed a step. I hope its you!


TROUBLE SHOOTING
If you make a mistake check the apache error log for clues, or the windows event viewer, apache writes errors to this as well as its error log.

If all else fails, delete the new apache.x.y.z folder and re run the Right click on wamp manager -> Refresh and it will re configure itself without your new apache and you can start again.










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 www.php.net/download or if its not a current release try 'http://windows.php.net/downloads/releases/archives'
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 ), you its a mine field.

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.

It should look something like this:




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

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.


You must ensure that you download the correct version to match your PHP :-
compiler( VC6/VC9 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.
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

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.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"




Once this s completed you can use the Wampmanager menus to switch versions of PHP and Apache.

You may get the odd error message but just presivere with the switching and you should get the correct Apache and PHP loaded.

---------------------------------------------------------------------------------------------
(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 06/16/2014 04:38PM by RiggsFolly.

Options: ReplyQuote
Pages: Previous12
Current Page: 2 of 2


Sorry, only registered users may post in this forum.