Installing PHP 5.4.0alpha1 into Wampserver

So, around a week ago PHP 5.4.0alpha1 was released to the QA guys. What does this mean for us? It means we can get a copy of it and tinker around with some of the new features, like traits.

I wanted to do exactly that, and at work we use WampServer so we can easily switch between PHP versions (and it also makes enabling/disabling extensions and options very easy – if you develop on Windows, check it out).

Assuming you have WampServer installed, it is fairly trivial to manually install new versions of the AMP trifecta. Below are the steps to install both PHP 5.4.0alpha1 and Apache 2.2.19-VC9 (which is necessary to run the pre-compiled Windows PHP binaries)

  1. Download “httpd-2.2.19-win32-x86-ssl.zip” from Apache Lounge
  2. Download the “VC9 x86 Thread Safe” zip of PHP 5.4.0alpha1 from the Windows PHP QA Site
  3. Extract both zip files
  4. Copy the resulting folders into your WampServer bin directory:
    Apache should go in \wamp\bin\apache\apache2.2.19-VC9 (or similar – the important bit is that you place it under \bin\apache)
    PHP should go into \wamp\bin\php\php5.4.0alpha1-VC9
  5. Now if you look inside your existing apache folder (\wamp\bin\apache\Apache2.2.17, for example)  you should see a file called wampserver.conf. Copy this file into your new apache installation.
  6. Do the same as step5 for your new PHP installation.
  7. It’s a good idea at this stage to copy your existing http.conf (and associated conf files – like vhosts for example) from your previous Apache installation into the new one – otherwise Apache may not start since it will be looking at the Apache default install location etc.
  8. Close WampServer and then start it again; it will read the folders and wampserver.conf files and you should now have the new Apache version and the PHP 5.4.0alpha1 in your WampServer menu!
  9. Open the Apache submenu, hit version and choose the new Apache version. Do the same for PHP. It may take a f couple of goes to get the new Apache + PHP versions to become “active” as I’ve found WampServer can sometimes silently fail to set a new version.
  10. Take a look at http://localhost/?phpinfo=1 and you should see that you are running version 5.4 :-)
Now you can play with all the great new features of PHP 5.4, including traits, array dereferencing and more.
Next time, I’ll show you how to you can hack customise the WampServer menu to add some helpful shortcuts and change the default text editor used for links to config files.
About these ads

6 thoughts on “Installing PHP 5.4.0alpha1 into Wampserver

  1. Pingback: Nils Luxton’s Blog: Installing PHP 5.4.0alpha1 into Wampserver

  2. Pingback: Nils Luxton Blog: Installation von PHP 5.4.0alpha1 in Wampserver | PHP Boutique

  3. Pingback: Nils Luxton’s Blog: Installing PHP 5.4.0alpha1 into Wampserver | Scripting4You Blog

  4. Was having issues making 5.4.0 appear and just realised in Step 6 (copying wamp config for PHP) make sure to also copy the other below files otherwise it will not appear in the list:

    – php.ini
    – phpForApache.ini

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s