1
msg7086 Feb 10, 2015
你nginx在哪个权限下?
如果是纯粹自己用的话,nginx和php的运行用户都设成www-data,然后用你第一种里的命令就好了。 |
3
1dian01 OP |
4
msg7086 Feb 10, 2015 php的pool里面找你的对应pool设定,里面user=和group=改掉就好了
|
5
msg7086 Feb 10, 2015
而且我看你上面写的是 No such file or directory 你确定是因为权限问题而不是你指错目录了?
|
7
msg7086 Feb 10, 2015
你web目录的权限是?
|
9
msg7086 Feb 10, 2015
@1dian01 权限,不是属主。
另外你上面提示是 Unable to open primary script: /usr/share/nginx/xxx/index.php 所以你web目录是 /usr/share/nginx/xxx ? |
10
1dian01 OP 是的,我的web目录是 usr/share/nginx/xxx
那我还需要另外设置权限?,这个对吗? chmod -R 755 usr/share/nginx/xxx |
11
youling Feb 10, 2015
# find /home/yourblog/ -type d -exec chmod 755 {} ;
# find /home/yourblog/ -type f -exec chmod 644 {} ; #chown www-data:www-data /home/yourblog/ -R |
12
msg7086 Feb 10, 2015
@1dian01 你不at我,我是看不到的。
-R 755是不行的。 以下是你要检查的问题。 1. 用htop或者top或者ps来检查nginx和php-fpm的运行用户是否正确。 2. 查看/usr/share/nginx/xxx目录以及里面index.php文件的权限。 3. 试着su到www-data,访问你的程序index.php看看能否读取。 |