Use 32 Bit WAMPI had issues installing my PHP versions manually when using the 64 bit version of
wampand found the 32 bit version worked much better. Installing right over the 64 bit version with the 32 bit version didn’t seem to have any troubles for me and I also tested going back and forth a few times which didn’t seem to create any issues.
I would recommend at least installing the latest version of
wampavailable as it is usually only a few versions behind and I find it a good idea to copy the config files straight over so that it plays nicely with
Getting PHPFirst you will need to download whatever version of PHP it is you are looking for:
Latest Version: http://windows.php.net/downloads/releases/
Archived Versions: http://windows.php.net/downloads/releases/archives/
You will see a bunch of files in there, mostly in arrangements like so:
Thursday, December 20, 2012 12:23 AM 16507699 php-5.4.10-nts-Win32-VC9-x86.zip Thursday, December 20, 2012 12:23 AM 16650112 php-5.4.10-Win32-VC9-x86.zipYou’ll want to grab the
php-5.4.10-Win32-VC9-x86.zipwhich is the
thread safeversion, the
ntsin the other file stands for
not thread safe.
Installing PHP into WAMPOnce we have the zip file downloaded, we’ll simply extract the contents into the
wamp/bin/php/php5.x.xfolder. So say we downloaded
php 5.4.10then we would put the contents into:
Copy wampserver.conf FileEach PHP directory you install into
wampwill have a
wampserver.conffile. Unless you have a really old version of
wampinstalled you will probably just be able to copy this one straight over from a previous PHP version you already have installed.
C:/wamp/bin/php/php5.4.10/wampserver.confAgain, if you notice you are having issues, try installing the latest version of
wampavailable and grabbing the file from there.
Copy PHP Config FilesYou will need to copy two configs from your currently working PHP directory, they are called
php.ini. These are the ones used by
wampand the system (CLI) respectively. It’s best to copy these over from a previous
wampinstall as they are setup in a way for
wampto read properly.
This will probably not produce any errors for you unless you have a really old version of PHP currently setup, but anything in the
5.4family shouldn’t have any issues.
You’ll then need to update the
extension_dirpath to the directory of the PHP zip file you just extracted.
extension_dir = "c:/wamp/bin/php/php5.4.10/ext/"Note that these changes should be made in both
inifiles. Also note that if you don’t copy these changes over any php changes you have made to your
inifiles will need to be copied over as well.
Installing PECL LibrariesSometimes you will want to install additional extensions for PHP to work with. There is a nice set of compiled and ready to go for Windows libraries that can be found in the pecl releases section of the windows.php.net website.
A more common extension typically used is the
oAuthlibrary which is used to communicate with sites like Facebook, Twitter and Linkedin. I’ve previously written an article on Installing PHP oAuth on Windows which covers the steps required to accomplish this. Similar steps can be used with the other libraries there.
Restart WAMPIn order to see the new version of PHP along with any additional extensions you have installed you will need to fully exit and then restart
Update Windows Path VariablesOne last update you will want to do is to update your windows
PATHvariable to point to the new version of php in order to be able to execute PHP via command line. This will be important if you have any scripts running. You can find the PATH variable in your environment variables and there should already be an entry for PHP there so you will just need to update the path.
In order for
PATHenvironment variable changes to take effect you will need to log out of your windows session and log back in. Once back in you can check your php is up to date by typing in
php -vinto the command line.
C:\>php -v PHP 5.4.10 (cli) (built: May 14 2012 02:50:59) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
Installing PHP oAuth on Windows
How to Design a REST API and Why You Should
The Ultimate Guide to Writing jQuery Plugins
10 Awesome jQuery Tag Cloud Plugins
jQuery Plugin Development Boilerplate