192:~ Hanger$ ./start.sh
nginx: [alert] could not open error log file: open() "/usr/local/nginx-1.10.1/logs/error.log" failed (13: Permission denied)
2017/03/07 08:39:53 [emerg] 1227#0: open() "/usr/local/nginx-1.10.1/logs/access.log" failed (13: Permission denied)
192:~ Hanger$
Mac下,我在终端输入以上代码出错,其中 start.sh 文件内容如下,求告知这个问题如何解决?
#!/bin/sh
# linux上nginx,php,mysql集成环境
# Author salamander
set -e # "Exit immediately if a simple command exits with a non-zero status."
basepath=$(cd `dirname $0`; pwd)
/usr/local/nginx-1.10.1/sbin/nginx
/usr/local/opt/php70/sbin/php70-fpm start
echo 'PHP Nginx started successfully!'
13: Permission denied 这个就是权限不足
could not open error log file: open() "/usr/local/nginx-1.10.1/logs/error.log" failed
这句话的意思就是:无法打开错误日志,打开"/usr/local/nginx-1.10.1/logs/error.log"失败
这样应该明白了吧!主要是权限不足造成的,应该是运行nginx的用户权限太低了