环境: centos7 nginx 1.8 php 5.6 mariadb ( mysql )
原先的服务器到期然后在新的机器上搭好 lnmp 准备搬迁(原先机器也是 lnmp ,而且新的 lnmp 搭建按照原先自己总结出的笔记来),因为原先是 centos6 ,所以有一点不同之处就是 mysql 和 mariadb ,搭好之后安装 wp 的时候 config.php 无法生成(连接数据库那个),权限问题我把网站根目录权限设为 777 ,用户和用户组设为 nginx ,无法解决!然后想起用了 php-fpm ,去看下 php-fpm 的设置,发现有 user 和 group ,两个值均为 apache ,我改回 nginx 之后仍然无法解决! 再然后我去建了个 php ,尝试通过 php 生成一个文本( txt ),结果仍然不行, nginx 报错如下:
2016/04/10 04:51:06 [error] 9690#0: *2384 FastCGI sent in stderr: "PHP message: PHP Warning: fopen(/usr/share/nginx/html/aa.txt ): failed to open stream: Permission denied in /usr/share/nginx/html/ttt.php on line 3 PHP message: PHP Warning: fputs() expects parameter 1 to be resource, boolean given in /usr/share/nginx/html/ttt.php on line 4 PHP message: PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /usr/share/nginx/html/ttt.php on line 5" while reading response header from upstream, client: 183.36.50.172, server: (本机域名), request: "GET /ttt.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "(本机 IP )"
求救!!!!
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.