1, the preparation of resources:
Nginx Download Address: http://nginx.org/download/nginx-1.3.14.zip
PHP Download Address: http://windows.php.net/downloads/releases/php-5.2.17-nts-Win32-VC6-x86.zip
MySQL Download Address: http://www.mysql.com/downloads/installer/
1, first uninstall the system from the Apache
The code is as follows |
Copy Code |
Yum Remove httpd |
2, install MySQL, set password, etc., you can refer to CENTOS6 installation MySQL and configure the import backup
The code is as follows |
Copy Code |
Yum install MySQL Mysql-server |
3, installation Nginx, if Yum installation
The code is as follows |
Copy Code |
Yum Install Nginx |
4, the installation of PHP and related modules
The code is as follows |
Copy Code |
Yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcryp T php-mssql php-snmp Php-soap Php-tidy
|
#编辑文件php. ini, add cgi.fix_pathinfo = 1 at the end of the file
Vi/etc/php.ini
#启动php-FPM
The code is as follows |
Copy Code |
Service PHP-FPM Start |
Related nginx configuration file:
The code is as follows |
Copy Code |
server { Listen 80; server_name localhost;
#access_log/var/nginx/logs/acccess-ebiz.log; # Proxy The PHP scripts to Apache listening on 127.0.0.1:80
Location/{ Root/var/www/ecshop; Index index.html index.htm index.php; AutoIndex on; }
# location ~ php$ { # Proxy_pass http://127.0.0.1; #}
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
Location ~. php$ { Root/var/www/ecshop; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; }
#error_page 404/404.html;
# REDIRECT Server error pages to the static page/50x.html # #error_page 502 503 504/50x.html; Location =/50x.html { Root/var/www/nginx-default; }
} |
Finally create a new PHP file, add:
The code is as follows |
Copy Code |
<?php Phpinfo (); ?> Date.timezone = asia/chongqing Session.auto_start =1 |