This article mainly introduces WAMP to add a new version of php, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
1.1. Stop the WAMP server.
2. Download the PHP version to be installed. Download the Window version ZIP package: http://windows.php.net. Unzip it to Wamp’s installation directory\bin\php\php7.1.0. --- Pay attention to whether you are vc11 or vc14 vc 9
3. From the existing php version file (such as php7.0.4 (eg. wamp/bin/php/php7.0.4 ) Copy the following files: - php.ini, phpForApache.ini and wampserver.conf to the php7.1.0 folder.
4. Open the following files in the php7.1.0 folder: - php.ini and phpForApache.ini And replace all 7.0.4 with 7.1.0.
5. Modify the Wamp configuration file: Enter the Wamp installation directory, use IDE or Notepad (preferably Use a notepad with line number positioning, such as EditPlus, etc.) to open wampmanager.ini and locate line 335. This line is usually [phpVersion]. If not, look for it nearby. Copy the following line:
Type: item; Caption: "5.6.19"; Action: multi; Actions:switchPhp7.0.4
is inserted in front of this line and modified to
Type: item; Caption: "5.6.19" ; Action: multi; Actions:switchPhp7.1.0
[switchPhp5.3.0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: " Wamp’s installation directory/bin/php/php5.6.19/php-win.exe";Parameters: "switchPhpVersion.php 5.3.0";WorkingDir: "Wamp’s installation directory /scripts"; Flags: waituntilterminated
Action: run; FileName: "Wamp's installation directory/bin/php/php5.6.19/php-win.exe";Parameters: "-c . refresh .php"; WorkingDir: "Wamp's installation directory/scripts"; Flags: waituntilterminated
Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
Insert this paragraph before and modify it to
[switchPhp7.1. 0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp’s installation directory /bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php7.1.0";WorkingDir: "Wamp’s installation directory/scripts"; Flags: waituntilterminated
Action : run; FileName: "Wamp's 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;
6. Go to wamp/bin/apache/apache/apache2.2.11/bin to delete the php.ini file.
7.. Restart wamp.
8. Select the php7.1.0 version. Wamp will be restarted after selection.
9. You can open phpinfo to see if there is php7.1.0 information at this time, and then open Phpmyadmin to see if it can be accessed.
10.Done.
(Note: php7.1.0 does not support mysql-connect() to connect to the mysql database)
Related recommendations:
nginx adds php basic verification
The above is the detailed content of WAMP adds new version of php. For more information, please follow other related articles on the PHP Chinese website!