diff --git a/nginx-mysql/README.md b/nginx-mysql/README.md index ffca6df..64ea010 100644 --- a/nginx-mysql/README.md +++ b/nginx-mysql/README.md @@ -1,14 +1,23 @@ -vi /usr/local/nginx/conf/nginx.conf #编辑配置文件,需做如下修改 -user www www; #首行user去掉注释,修改Nginx运行组为www www;必须与/usr/local/php/etc/php-fpm.conf中的user,group配置相同,否则php运行出错 -index index.php index.html index.htm; #添加index.php +``` +vi /usr/local/nginx/conf/nginx.conf #缂栬緫閰嶇疆鏂囦欢,闇鍋氬涓嬩慨鏀 +``` + +``` +user www www; #棣栬user鍘绘帀娉ㄩ噴,淇敼Nginx杩愯缁勪负www www锛涘繀椤讳笌/usr/local/php/etc/php-fpm.conf涓殑user,group閰嶇疆鐩稿悓锛屽惁鍒檖hp杩愯鍑洪敊 + +index index.php index.html index.htm; #娣诲姞index.php + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { -root html; -fastcgi_pass 127.0.0.1:9000; -fastcgi_index index.php; -fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -include fastcgi_params; + root html; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; } -#取消FastCGI server部分location的注释,并要注意fastcgi_param行的参数,改为 -$document_root$fastcgi_script_name,或者使用绝对路径 -/etc/init.d/nginx restart #重启nginx +#鍙栨秷FastCGI server閮ㄥ垎location鐨勬敞閲,骞惰娉ㄦ剰fastcgi_param琛岀殑鍙傛暟,鏀逛负 $document_root$fastcgi_script_name,鎴栬呬娇鐢ㄧ粷瀵硅矾寰 +``` + +``` +/etc/init.d/nginx restart #閲嶅惎nginx +```