• 07/10/2014 • 4 phút đọc • 13 lượt xem

Manually adding PHP Versions to WAMP

Việt Lâm Coder
Việt Lâm Coder
Senior Fullstack & System Architect • Hotline: 0944.71.4545

Manually Adding PHP Versions to WAMP

Since WAMP is usually a little behind on it’s versions of Apache, MySQL and PHP we may sometimes need to install them manually. I find this not as big an issue with Apache or MySQL but typically prefer to have my PHP version as up to date as possible. Hence this little tutorial goes over the brief steps required to quickly update your PHP versions manually in WAMP.

Use 32 Bit WAMP

I had issues installing my PHP versions manually when using the 64 bit version of WAMP and 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 WAMP available 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 WAMP.

Getting PHP

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

1
2
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.zip

You’ll want to grab the php-5.4.10-Win32-VC9-x86.zip which is the thread safe version, the nts in the other file stands for not thread safe.

Installing PHP into WAMP

Once we have the zip file downloaded, we’ll simply extract the contents into the wamp/bin/php/php5.x.x folder. So say we downloaded php 5.4.10 then we would put the contents into:

1
C:/wamp/bin/php/php5.4.10/

Copy wampserver.conf File

Each PHP directory you install into WAMP will have a wampserver.conf file. Unless you have a really old version of WAMP installed you will probably just be able to copy this one straight over from a previous PHP version you already have installed.

1
C:/wamp/bin/php/php5.4.10/wampserver.conf

Again, if you notice you are having issues, try installing the latest version of WAMP available and grabbing the file from there.

Copy PHP Config Files

You will need to copy two configs from your currently working PHP directory, they are called phpForApache.ini and php.ini. These are the ones used by WAMP and the system (CLI) respectively. It’s best to copy these over from a previous WAMP install as they are setup in a way for WAMP to 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.3 or 5.4 family shouldn’t have any issues.

You’ll then need to update the extension_dir path to the directory of the PHP zip file you just extracted.

1
extension_dir = "c:/wamp/bin/php/php5.4.10/ext/"

Note that these changes should be made in both ini files. Also note that if you don’t copy these changes over any PHP changes you have made to your ini files will need to be copied over as well.

Installing PECL Libraries

Sometimes 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 oAuth library 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 WAMP

In 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 WAMP.

Update Windows Path Variables

One last update you will want to do is to update your windows PATH variable 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 PATH environment 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 -v into the command line.

1
2
3
4
5
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
Việt Lâm Coder

Việt Lâm Coder

Tác giả bài viết và chuyên gia quản trị website. Nếu bạn gặp khó khăn trong quá trình thực hiện hoặc có nhu cầu thiết kế website, lập trình web app Laravel, hãy liên hệ ngay với tôi qua Hotline / Zalo: 0944.71.4545.

☕ Mời Tác Giả Ly Cà Phê Ấm Lòng

Nếu bài viết này giúp ích cho công việc của bạn, hãy tiếp thêm động lực cho tác giả duy trì kho tri thức bằng một ly cà phê ấm lòng nhé!

Mã QR ủng hộ tác giả
Ngân hàng TMCP Quân Đội (MB Bank)TONG VIET LAM

Có Thể Bạn Quan Tâm

Cách Mở Tab Ẩn Danh Trên Safari MacBook Đơn Giản

Cách mở tab ẩn danh trên Safari MacBook sẽ giúp cho người dùng có thể bảo vệ quyền riêng tư và duyệt web một cách an toà...

Hướng dẫn 5 cách tắt update Windows 11 vĩnh viễn chi tiết nhất

Mặc định Windows 11 sẽ được tự động cập nhật trong nền. Tuy nhiên nếu vì lý do nào đó mà bạn không muốn nhận các bản...

Hướng dẫn trỏ file hosts cho domain trên hệ điều hành Windows

– Làm cách nào để 1 website có thể hoạt động trên Share hosting, VPS, Server mà không cần cấu hình các record DNS cho do...

Kích hoạt Cloudflare Turnstile trong Contact Form 7 chống spam

Cloudflare Turnstile là giải pháp xác thực không dùng CAPTCHA giúp bảo vệ website WordPress khỏi spam một cách nhẹ nhàng...

Cách Sử Dụng DeepSeek R1 Miễn Phí Trong Visual Studio Code Với Cline?

Hãy đối mặt với thực tế: Các trợ lý lập trình AI như GitHub Copilot thì tuyệt vời, nhưng chi phí đăng ký của chúng có th...

Gmail API – Tất cả những gì bạn cần biết - 2025

Nếu bạn đang tìm cách tích hợp Gmail vào các ứng dụng của riêng mình thì Gmail API chính là thứ bạn cần! Gmail là một lự...

Hướng dẫn tạo màn hình desktop ảo bằng Task View trên Surface Windows 11

Việt Lâm Coder sẽ hướng dẫn tạo lập nhiều màn hình desktop ảo bằng Task View trên Surface Windows 11 để sắp xếp các tác...

How to Transfer PuTTY Sessions To Another Windows Machine

his is an user contributed article. PuTTY is a terminal emulator application which can act as a client for the SSH, T...

Hướng dẫn cách kiểm tra cổng đang mở (Check open port) trên linux

Với nhiều năm kinh nghiệm hỗ trợ Khách hàng của Tenten, chúng tôi nhận thấy việc thường xuyên theo dõi kiểm tra hoạt độn...

Kiểm tra tất cả các port mà Cyber Panel đang cần có được mở hay không ?

Để kiểm tra tất cả các port cùng một lúc, bạn có thể sử dụng lệnh: netstat -tulpn | grep -E ':(8090|80|443|21|40110|401...

Hướng dẫn cài đặt KeyHelp Panel

Tóm tắt về KeyHelp Bạn đã có phần cứng tốt nhất cho các dự án Internet của mình nhưng việc quản lý phức tạp, hiệu suất...

Tổng hợp danh sách Control Panel VPS free tốt nhất hiện nay

Control Panel VPS free cung cấp một lựa chọn tuyệt vời cho những người dùng muốn quản lý VPS một cách dễ dàng và hiệ...