Home > Article > Backend Development > How to install php7 under windows?
Installation method: 1. Download the appropriate php7 installation package from the official website, then unzip it and rename the folder to "php7"; 2. Open the php7 folder, find the "php.ini-development" file, and rename it. Name it "php.ini"; 3. Configure the php.ini file; 4. Add PHP environment variables.
Recommended: "PHP Video Tutorial"
How to install php7 under windows
1. Download PHP7
#1), first open the official website and download the appropriate php7 installation package
If the computer is windows If the system is 64-bit, select the "VC14 x64 Thread Safe" zip package to download
#2). After downloading, unzip the compressed package to the name "php7 "In the folder of Open the php7 folder and find the configuration file. Generally, there are two default files: one is "php.ini-development" for the development environment, and the other is "php.ini-production" for the production environment
2) Just change the name of any configuration file to "php.ini".
3) Open the configuration file and find extension_dir on line 738. Change extension_dir="ext" to your installation path and add ext, such as "d:/php7 /ext”4), open the extension, find the extension you want to activate, remove the “;” in front of the extension,
3. Add PHP environment variables
Finally, we need to let Windows know where to find our PHP installation.
We can take the following steps:
a. Open theControl Panel->System and Security
Settings->System
b. ClickAdvanced System Settingsc. Click the Environment Variables button
d.In# Select the path variable under ##System Variablesand click the Edit button
e. In the new pop-up window, click the New button and add " The installation path of PHP7 "
f. Click OK, OK, OK. The PHP environment variable has now been addedFinally to confirm whether PHP is successfully installed on your computer, please open the command prompt and enter Powershell:> powershell
Now that we are in Powershell, we can pass Run the following command to check whether PHP is installed:
> php -v
You will see the following output:
Note: To start the PHP server in the current directory, you can Run the following command:> php -S localhost:8000
Now you can visit localhost:8000 in your browser to serve any .php file in that directory.
Create a new test file in the web server and add a method to view the PHP configuration information in the file. If running the file displays the version of PHP installed, the installation is successful
Introduction to Programming
! !The above is the detailed content of How to install php7 under windows?. For more information, please follow other related articles on the PHP Chinese website!