28

I'm trying to install PHP 5.3.8 to work with WAMP (Windows).

I downloaded it from the PHP website, copied it in the bin folder, and added this line to wampmanager.ini:

Type: item; Caption: "5.3.8"; Action: multi; Actions:switchPhp5.3.8;

and:

[switchPhp5.3.8]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "c:/wamp/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php 5.3.8";WorkingDir: "c:/wamp/scripts"; Flags: waituntilterminated
Action: run; FileName: "c:/wamp/bin/php/php5.3.0/php-win.exe";Parameters: "-c . refresh.php";WorkingDir: "c:/wamp/scripts"; Flags: waituntilterminated
Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated
Action: resetservices
Action: readconfig;

But it doesn't work...

After I edit it and start WAMP, those changes get removed from the ini file.

Alex
  • 899
  • 5
  • 20
  • 32
  • Have you tried downloading it from the [WAMP Addon Site](http://www.wampserver.com/en/addons_php.php)? EDIT: Just realised the most recent version on there is 5.3.1, sorry. – tombull89 Sep 15 '11 at 13:15
  • This is not the right place for this question. Everyone should down vote this question. I need 4 more reps...then I will do it. :P :P – Smokey Jul 25 '14 at 05:28

4 Answers4

49

I needed a way to manually install PHP 5.4, because there's no PHP 5.4 addon for my WampServer version.

This thread is a bit old but I'll give the procedure here, as it match to the original question.

I'll take PHP 5.4.13 for my example (currently the most recent 5.4 version)

  1. Download binaries on php.net
  2. Extract all files in a new folder : C:/wamp/bin/php/php5.4.13/
  3. Copy the wampserver.conf from another php folder (like php/php5.2.8/) to the new folder
  4. Rename php.ini-development file to phpForApache.ini
  5. Done ! Restart WampServer (>Right Mouseclick on trayicon >Exit)

ℹ️
If you are adding php version 5.6, you need to copy php5apache2_4.dll from other php folder, too, otherwise the wamp server won't start.

ℹ️
If you are adding php version 8+, you also need to copy php8embed.lib, php8phpdbg.dll, php8ts.dll, php-cgi, phpdbg and php-win files for wamp server to be able to start.

zessx
  • 813
  • 1
  • 9
  • 21
  • 11
    Great answer. Just to be clear as it tripped me up, by `Restart WampServer`, it means Right click the tray icon, click exit, then open WAMP again, rather than clicking the `Restart All Services` button. – MrLore Jul 20 '14 at 01:19
  • 2
    Just want to note that the extracted folder says php-5.6.18 and in Php->Version it displays -5.6.18 Did it make any difference? Or I need to rename folder to 5.6.18 by removing - ? – mujaffars Feb 15 '16 at 13:27
  • I have wamp2.5 with php5.5, then i tried this solution to install php5.4 but whenever I change php to 5.4, I cant run any project in my local computer. It seems that apache is not running. Tried to manually click apache >> start service, but still no luck – Alex Coroza Mar 07 '16 at 12:02
  • I am trying to update from php5.5.12 to php7.0.2 for Magento 2 It's not working wamp logo not changing orange color. – Gem Oct 27 '17 at 05:21
  • 1
    link http://programming-tips.in/php-configure-php-7-on-wamp/ – Gem Oct 27 '17 at 05:21
  • It's not working. I tried downloading PHP 7.4.19 this way and it's not showing up if I go to Wamp menu > PHP > Version. – Donald Duck May 09 '21 at 15:45
  • working, I had php 7.3 and installed php 7.2 with your method, thank you – Omar Dec 09 '21 at 14:14
  • Added `PHP 8` in `WAMP 3.1.6` following the ninstructions in this answer and I got this error (visible in windows event viewer) when starting apache: `httpd.conf: Can't locate API module structure php8_module`. To fix it, follow this answer to modify `httpd.conf` : https://stackoverflow.com/a/64539221 – Alex P. May 18 '22 at 12:06
7

I too needed to upgrade PHP in WAMP recently. There are a handful of steps to properly do so. I covered them all and provided screenshots in the post linked to above.

Hope it helps!

John Dugan
  • 171
  • 1
  • 2
  • 2
    Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Mar 23 '21 at 11:54
  • It's not working. I did exactly as it said to install PHP 7.4.19 and it doesn't show up in the list of PHP versions in the WAMP menu. – Donald Duck May 09 '21 at 15:57
3

This is another helpful article about changing the php version in wamp.

A useful detail that is mentioned in the article is to update the environment variable to point to the new php, so you can get access to the right php cli.

Alex Lomia
  • 133
  • 6
2

why don't you install last version of WAMP

WampServer 2.1a [24/12/10] Includes :

  • Apache 2.2.17
  • Php 5.3.3
  • Mysql 5.1.53 (version 64 bits)
  • Mysql 5.5.8 (version 32 bits)
  • PhpMyadmin 3.2.0.1
  • SQLBuddy 1.3.2
Remus Rigo
  • 2,927
  • 8
  • 48
  • 62