1. Create an AMP folder in a directory with pure English and no spaces, and create three software subfolders in AMP
2. First install Apache. When installing, pay attention to the path to select manual installation and install it into the Apache file created by yourself.
After completion, enter localhost in the browser address bar and the page displays It works!
3. Add environment variables
Right-click on the computer→Properties→Advanced System Settings→Environment Variables→System Variables→Find Path and double-click→Variable Value→Add a path at the end, pay attention to see if there is a semicolon in front of the path you add, if not, remember to add a semicolon, it is best Copy the content inside and add it outside. After confirming that it is correct, copy it in. The path is the bin file under the Apache path.
4. Unzip the PHP installation package and put the files in the PHP folder created by yourself
Find a copy of php.ini-developmentl in the PHP file, rename it to php.ini as the PHP configuration file
Configure the php.ini file:
Specify the location of the extension file: extension_dir = "C:\DW\dlhj\AMP\php\ext'
’
To enable MySQL and MySQLi extensions, just delete the comments of the original file, and the command is at the top without spaces.
Set the time zone (change to China) date.timezone = PRC
Configure Apache files
Find the httpd.conf file under the Apache file
Configurations that need to be changed:
LoadModule php5_module "C:\DW\dlhj\AMP\php\php5apache2_2.dll"
<FilesMatch "\.php$">
setHandler application/x-httpd-php
</FilesMatch>
PHPIniDir "C:\DW\dlhj\AMP\php"
Set site directory (directory where code is placed)
DocumentRoot "D:\HTML" <Directory "D:\HTML">