windows Server Install Apache PHP MySQL; Windows Server environment installation Web server (Apache, PHP, Mysql) graphic tutorial; Apache (HTTP) Windows installation tutorial
Environmental preparation:
- Windows Server 2012
- mysql-5.7
- httpd-2.4
- php-5.6 (Remember to be optimistic about the version x64 VC11 when downloading from the official website)
Apache(httpd)
Apache official website download URL
After downloading, create a new wamp directory and unzip it
Then start to modify the default configuration, enter the Apache24 directory, find \wamp\Apache24\conf\httpd.conf and open it with an editor
Find Define SRVROOT and modify the value in the quotation marks to the absolute path where you store Apache24 (I am the F drive here)
Example #
Define SRVROOT "F: / wamp / Apache24"
Open the apache mod_rewrite module as needed
LoadModule rewrite_module modules/mod_rewrite.so
Change AllowOverride None to AllowOverride All
# Find < Directory "$ {SRVROOT} / the htdocs" > the AllowOverride None # modify AllowOverride All
Continue to install the Apache service and open the cmd window ( refer to the official website document )
Find the absolute path of the httpd.exe file in the Apache24 directory and follow it
httpd.exe -k install -n Apache2.4
The installation is successful, find ApacheMonitor.exe in the Apache24 directory and double-click to run it ( F:\wamp\Apache24\bin\ApacheMonitor.exe )
An icon appears in the lower right corner of the desktop , double-click to open the window interface,
Click Start to start running
You can also operate apache related commands in cmd. Refer to the official documentation here
#Stop the service
httpd.exe -k shutdown #or
httpd.exe -k stop #Start the
service
httpd.exe -k start #Restart the
service
httpd.exe -k restart
PHP
Download from PHP official website , here is PHP 5.6 (5.6.37)
Create a new folder in the wamp directory and name it php, then unzip the downloaded compressed package, load the php5apache2_4.dll inside into apache, open the httpd.conf of apache in the editor, and add this sentence
LoadModule php5_module "F:/wamp/php/php5apache2_4.dll"
Continue to find <IfModule dir_module> increase
<IfModule dir_module> DirectoryIndex index.php index.html </IfModule>
Continue to add the following sentence to let Apache recognize the suffix of the php file, so as to analyze the application of these suffixes
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
save document.
Then start to configure php, enter the php directory, make a copy of php.ini-development, and then rename the copy to: php.ini, open it with an editor
Find On windows, remove the following extension_dir = "ext" in front of the; comment, and then add the absolute path of ext
Continue to find the corresponding extensions of Dynamic Extensions followed by php. Remove the comments to enable.
Open some commonly used extensions
# The foregoing; remove
Extension = php_curl.dll
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
Extension = php_pdo_mysql.dll
Modify some php default settings
expose_php = Off
date.timezone = Asia/Shanghai
Save, restart apache to view phpinfo
At this time, you find that the path of php.ini is not loaded into the official document. Common problems with PHP installation
Continue to modify environment variables, remember to apache and PHP bin paths are added to the environment variable Path in
Mysql
Mysql official website download address ( Mysql5.7 version )
After opening it, pay attention to the selected version. The 5.7 version is used for the demonstration, as shown below:
Click the link to enter the following page:
Choose Windows 64bit
Start downloading (attached to Baidu Cloud download address: mysql-5.7.23-winx64.zip ) Password: 4w8q
After downloading, unzip the compressed package mysql-5.7.23-winx64.zip and rename mysql
Then add the environment variable and append the absolute path of the bin directory under mysql to the environment variable Path,
Enter the cmd operation to generate the data directory first, then install the mysql service and then start mysql (no need to create a my.ini configuration file)
#Login mysql mysql -uroot -p
Stop mysql
net stop mysql
After installation, there is no my.ini file. If you need to modify some parameters, create a new my.ini file and configure it and place it in the C:\Windows directory and restart mysql.