Manually Install Multiple PHP versions on WampServer

Source: Internet
Author: User

 

WampServer is a software integrated with PHP/Mysql/Apache and other applications (such as PhpMyAdmin/Xdebug [maybe not]). It has its favorite features, it does not simplify the installation and configuration of Php, Mysql, and Apache, but allows us to switch between different installed versions of PHP, Mysql, and Apache with just a few clicks. PHP programmers are most confused about the needs of different PHP versions.

 

 

 

WampServer Version menu (Apache, PHP, and Mysql each have a Version menu), there is a Get More... connect and click it to download the required version on the official website. The installation is automated and simple. However, until I write this article, PHP5.2 on the official website can be up to 5.2.11, and PHP5.3 can be up to 5.3.1. 5.2 The latest 5.3.8 of 5.2.17 and 5.3 are not provided, and the update is very slow. What if we don't have the required version? Uncle Mao said a famous saying: Do it yourself and enjoy yourself!

 

 

 

To manually install the new PHP version, follow these steps:

 

 

Download the PHP version to be installed. Since WampServer is used, of course it is to download the ZIP package of the Window version: http://windows.php.net. Decompress the package to the Wamp installation directory \ bin \ php \ php5.2.17. Take 5.2.17 as an example.

Enter the Wamp installation directory \ bin \ php \ php5.2.17, from php. ini-dist or php. copy ini-recommended and rename it to php. ini, suitable for modifying php. ini configuration (such as extension_dir), and then from php. copy the ini file and rename it phpForApache. ini.

Copy a copy of wampserver. conf from the existing version directory. For example, if php5.3.0 is already available when I install WampServer, copy wampserver. conf to the installation directory \ bin \ php \ php5.3.0 under the installation directory \ bin \ php \ php5.2.17 of Wamp.

Modify the Wamp configuration file: Enter the Wamp installation directory, and open wampmanager with IDE or notepad (preferably a notepad located by a line number, such as EditPlus. ini, locate row 335, usually in this line is [phpVersion], if not, look nearby. Copy the following line:

Type: item; Caption: "5.3.0"; Action: multi; Actions: switchPhp5.3.0

Insert to the beginning of this line and modify it

Type: item; Caption: "5.2.17"; Action: multi; Actions: switchPhp5.2.17

Copy again

[SwitchPhp5.3.0]

Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated

Action: run; FileName: "Wamp installation directory/bin/php/php5.3.0/php-win.exe"; Parameters: "switchPhpVersion. php 5.3.0 "; WorkingDir:" Wamp installation directory/scripts "; Flags: waituntilterminated

Action: run; FileName: "Wamp installation directory/bin/php/php5.3.0/php-win.exe"; Parameters: "-c. refresh. php "; WorkingDir:" Wamp installation directory/scripts "; Flags: waituntilterminated

Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated

Action: resetservices

Action: readconfig;

Insert this section and modify it

 

[SwitchPhp5.2.17]

Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated

 

Action: run; FileName: "Wamp installation directory/bin/php/php5.3.0/php-win.exe"; Parameters: "switchPhpVersion. php 5.2.17 "; WorkingDir:" Wamp installation directory/scripts "; Flags: waituntilterminated

Action: run; FileName: "Wamp installation directory/bin/php/php5.3.0/php-win.exe"; Parameters: "-c. refresh. php "; WorkingDir:" Wamp installation directory/scripts "; Flags: waituntilterminated

Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated

Action: resetservices

Action: readconfig;

Log out of WampServer and restart. Complete.

You can install any version of PHP in these five steps.

 

An example of two files is attached:

 

1. Wamp installation directory \ bin \ php \ php5.2.17 \ wampserver. conf, which is actually a php File

 

 

<? Php

 

$ PhpConf ['phpinidir'] = '.';

$ PhpConf ['phpedir'] = '.';

$ PhpConf ['phpconffile '] = 'php. ini ';

 

 

$ PhpConf ['apache'] ['1. 3'] ['loadmodulename'] = 'php5 _ module ';

$ PhpConf ['apache'] ['1. 3'] ['loadlelefile'] = 'php5apache. dll ';

$ PhpConf ['apache'] ['1. 3'] ['addmodule'] = 'mod _ php5.c ';

 

$ PhpConf ['apache'] ['2. 0'] ['loadmodulename'] = 'php5 _ module ';

$ PhpConf ['apache'] ['2. 0'] ['loadlelefile'] = 'php5apache2. dll ';

$ PhpConf ['apache'] ['2. 0'] ['addmodule'] = '';

 

$ PhpConf ['apache'] ['2. 2'] ['loadmodulename'] = 'php5 _ module ';

$ PhpConf ['apache'] ['2. 2'] ['loadlelefile'] = 'php5apache2 _ 2. dll ';

$ PhpConf ['apache'] ['2. 2'] ['addmodule'] = '';

 

?>

 

 

2. Wamp installation directory \ wampmanager. ini

 

 

[PhpVersion]

; WAMPPHPVERSIONSTART

Type: item; Caption: "5.2.17"; Action: multi; Actions: switchPhp5.2.17; Glyph: 13

Type: item; Caption: "5.3.0"; Action: multi; Actions: switchPhp5.3.0

Type: separator;

Type: item; Caption: "Get more... "; Action: run; FileName:" C: \ Program Files (x86) \ Mozilla Firefox \ firefox.exe "; Parameters:" http://www.wampserver.com/addons_php.php ";

[SwitchPhp5.2.17]

Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated

Action: run; FileName: "D:/programs/wamp/bin/php/php5.3.0/php-win.exe"; Parameters: "switchPhpVersion. php 5.2.17 "; WorkingDir:" D:/programs/wamp/scripts "; Flags: waituntilterminated

Action: run; FileName: "D:/programs/wamp/bin/php/php5.3.0/php-win.exe"; Parameters: "-c. refresh. php "; WorkingDir:" D:/programs/wamp/scripts "; Flags: waituntilterminated

Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated

Action: resetservices

Action: readconfig;

[SwitchPhp5.3.0]

Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated

Action: run; FileName: "D:/programs/wamp/bin/php/php5.3.0/php-win.exe"; Parameters: "switchPhpVersion. php 5.3.0 "; WorkingDir:" D:/programs/wamp/scripts "; Flags: waituntilterminated

Action: run; FileName: "D:/programs/wamp/bin/php/php5.3.0/php-win.exe"; Parameters: "-c. refresh. php "; WorkingDir:" D:/programs/wamp/scripts "; Flags: waituntilterminated

Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated

Action: resetservices

Action: readconfig;

 

; WAMPPHPVERSIONEND

 

 

 

If you want to copy the above files, change the version number and path.

 

 

From the e

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.