1. Download PHP
2. Extract it on c:/wamp/bin/php/php5.x.x
3. Copy php.ini-development and paste it as php.ini.
4. Add the following lines to php.ini
extension_dir = “c:/wamp/bin/php/php5.x.x/ext/’
upload_tmp_dir = “c:/wamp/tmp”
session.save_path = “c:/wamp/tmp”
5. Copy php.ini and paste it as phpForApache.ini.
6. Copy wampserver.conf from the original php folder and paste it in this folder
7. Download php5apache2_4.dll from https://www.apachelounge.com/download/additional/ and put it in this folder
8. Close wamp and open it again.
Remark: If you want to install old version php, better install 32 bit WampServer instead of 64 bit.