Introduction
The PHP development environment should not be a difficult thing for every phper, like breathing. Below I teach you how to build PHP environment, is also a summary of my own, I hope to work with you to improve. (I hope you share, don't hide private OH)
"Ready to Work"
Get started, first look at your computer is how many bits of the operating system (do not ask Niang), My computer is 64-bit Win7 operating system, I take 64 bits as an example
PHP version: php-5.6.15-win32-vc11-x64.zip php download Address
Nginx version: nginx-1.8.0.zip nginx1.80 Download Address
MySQL version: mysql-5.6.27-winx64.zip mysql download address
Set up the environment directory, the individual likes to put the environment of things on the D-disk, so in the D-disk directory set up "Wnmp", the directory is built four folders 1.mysql 2.nginx3.web 4.php
"Installation Environment"
1.nginx
Unzip the downloaded Nginx-1.8.0.zip to D:\wamp\nginx
2.php
Download good php-5.6.15-win32-vc11-x64.zip and unzip to D:\wamp\php
3.mysql
Unzip the downloaded Php-5.6.15-win32-vc11-x64.zip to D:\wamp\mysql
"Configure Environment"
1.php Configuration
I'll finish it sometime.
2.nginx Configuration
I'll finish it sometime.
3.mysql free-Install version configuration
Unzip Php-5.6.15-win32-vc11-x64.zip to D:/wamp/mysql
Copy the default file My-default.ini in the extracted directory, rename My.ini and copy the following information to My.ini
*************************************************************************************************************** *************************
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
port=3306
Character_set_server=utf8
Basedir=d:\wamp\mysql
#解压目录
Datadir=d:\wamp\mysql\data
#解压目录下data目录
Sql_mode=no_engine_substitution,strict_trans_tables
[Winmysqladmin]
D:\wamp\mysql\bin\mysqld.exe
*************************************************************************************************************** **************************
4. Add Environment variables
The operation is as follows:
1) Right-click My Computer, properties, advanced system settings (advanced), environment variables
Click the New button under System variables
Input variable name: mysql_home
Input variable Value: D:\wnmp\mysql
#即为mysql的自定义解压目录.
2) Select path in the system variable
Click the Edit button
To add a variable value to a variable value:%mysql_home%\bin
Note that this variable is added after the value of the original variable, separated from it, and cannot delete the original variable value.
5. Run cmd to enter D:/wamp/mysql/bin to install the MySQL system service, after successful installation will prompt the service installation success.
Installation Services Command: mysqld install MySQL--defaults-file= "D:\wnmp\mysql\my.ini"
#移除服务命令为: Mysqld Remove
"Start Environment"
1. Create a file Start_gbk_server.bat
@echo off & title start Nginx Server
Color 0A
Inactive under REM Windows
REM Set php_fcgi_children=5
Call Stop_server.bat
REM maximum number of requests processed per process, or set to Windows environment variable
Set php_fcgi_max_requests=1000
echo Launcher php-5.4.19 FastCGI ...
RunHiddenConsole.exe d:/wnmp/php/php-cgi.exe-b 127.0.0.1:9000-c "D:/wnmp/php/php.ini"
echo Start Nginx 1.6.3
RunHiddenConsole.exe d:/wnmp/nginx/nginx.exe-p D:/wnmp/nginx
echo Start Mysql 5.6
RunHiddenConsole.exe net start MySQL
echo Start Complete ...
2. Create a file Stop_bgk_server.bat
@echo Off & title Nginx
Color 0A
echo Stopping Nginx ...
taskkill/f/im nginx.exe > nul
echo Stopping PHP FastCGI ...
taskkill/f/im php-cgi.exe > nul
echo Stopping Mysql
net stop MySQL
"Test Environment"
The index.php content under the D:/wnmp/web directory is as follows:
Phpinfo ();
?>
Find the Hosts file in the west of C:\Windows\System32\drivers\etc with Notepad and then write the following hosts:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
#:: 1 localhost
127.0.0.1 www.example.com
Open the www.example.com in the browser if it appears as proof that the PHP environment is built successfully and if it is not successfully debugged