Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions nginx-mysql/README.md
Original file line number Diff line number Diff line change
@@ -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配置相同,否则php运行出错

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�еIJ���,��Ϊ
$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
```