Build an apache + php + mysql running environment locally in win10, and use win10apache
First download the required software:
Vc2015: https://www.microsoft.com/zh-CN/download/details.aspx? Id = 48145
Vc2012: http://www.microsoft.com/zh-CN/download/details.aspx? Id = 30679
Apache2.4: http://www.apachelounge.com/download
PHP: http://windows.php.net/download (download Thread security edition, I .e. Thread Safe)
Mysql: https://downloads.mariadb.com/archives/mysql-5.5/mysql-5.5.27-win32.msi
Install and configureApache
Apache version: Apache2.4.16
Decompress Directory: D: \ PHP \ Apache24
To install Apache2.4.16, you must first install the Visual C ++ Redistributable for Visual Studio 2015 Runtime Library.
(1). decompress the downloaded file and place it in the location to be installed.
(2) Open the httpd. conf file under Apache24 \ conf and modify the following key locations:
ServerRoot "D:/PHP/Apache24" (Apache installation location );
DocumentRoot "D:/PHP/Apache24/htdocs" (Apache default website root directory, which can be adjusted according to your preferences)
Modify the options of the root directory:
Before Modification
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride null
Require all granted
</Directory>
After modification
<Directory "D:/PHP/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# ServerName www.example.com: 80 => ServerName 127.0.0.1: 80 (remove the previous #)
DirectoryIndex index.html => DirectoryIndex index.html index. php index.htm (we added index. php index.htm)
ScriptAlias/cgi-bin/"c:/Apache24/cgi-bin/" changed
ScriptAlias/cgi-bin/"d:/PHP/Apache24/cgi-bin /"
<Directory "c:/Apache24/cgi-bin" >=> <Directory "d:/PHP/Apache24/cgi-bin">
(3) Open cmd and enter the following command line
D: Press enter.
Cd PHP \ Apache24 \ bin to the bin directory in Apache24
Httpd Press enter. If no prompt is displayed, the startup is successful.
If you want to add Apache24 to the service, run cmd as an administrator and enter the following command
D: Press enter.
Cd PHP \ Apache24 \ bin press ENTER
Httpd.exe-k install press ENTER
(4) Open the browser and enter "http: // localhost/" for testing. "It works!" is displayed !" Verify that the configuration is successful.
Install and configure PHP
PHP version: php5.6.14
Installation Directory: D: \ PHP \ php56
To install php5.6.14, you must first install the Visual C ++ Redistributable for Visual Studio 2012 Runtime Library.
(1). decompress the downloaded file and place it in the location to be installed;
(2) Copy php. ini-development and change it to php. ini.
(3) Let Apache24 load the PHP module, open Apache24 \ conf \ httpd. conf, and add
LoadModule php5_module "D:/PHP/php56/php5apache2_4.dll"
AddType application/x-httpd-php. php. html. htm
PHPIniDir "D:/PHP/php56" (tell apache php. ini location)
(4) open several common php extensions, open the php. ini file, and modify the following content:
; Extension_dir = "ext" => extension_dir = "D:/PHP/php56/ext" (remove the semicolon)
; Extension = php_mbstring.dll => extension = php_mbstring.dll
; Extension = php_mysql.dll => extension = php_mysql.dll
; Extension = php_mysqli.dll => extension = php_mysqli.dll
Note: To enable curl extension in win, libeay32.dll and ssleay32.dll must be placed in the directory included in the path environment variable.
(5) restart the Apache server
InstallMysql
Mysql version: mysql5.6.27
Click the file to install it.