PHP 7即将发布了,一直都是用5.6,今天有空新建了一个VirtualBox虚拟机试编译了一下PHP 7,整体非常顺利,而且5.6编译过程中的一些警告信息也没有了,当然也可能是编译环境不同,之前都是CentOS 6的系统,今天尝试了CentOS 7。
顺便安装了nginx测试了一下,开始一直403/404错误,类似:
2015/11/10 13:33:39 [crit] 10281#0: *52 open() "/www/www.domain.cn/public/info.php" failed (13: Permission denied), client: 192.168.56.1, server: localhost, request: "GET /info.php HTTP/1.1", host: "192.168.56.10"
2015/11/10 13:33:42 [crit] 10281#0: *52 open() "/www/www.domain.cn/public/info.php" failed (13: Permission denied), client: 192.168.56.1, server: localhost, request: "GET /info.php HTTP/1.1", host: "192.168.56.10"
2015/11/10 13:33:43 [crit] 10281#0: *52 open() "/www/www.domain.cn/public/info.php" failed (13: Permission denied), client: 192.168.56.1, server: localhost, request: "GET /info.php HTTP/1.1", host: "192.168.56.10"
2015/11/10 13:33:43 [crit] 10281#0: *52 open() "/www/www.domain.cn/public/info.php" failed (13: Permission denied), client: 192.168.56.1, server: localhost, request: "GET /info.php HTTP/1.1", host: "192.168.56.10"
PHP本身编译、安装没问题,控制台下也正常,所以怀疑SELinux问题,查看:
# ls -Z /www/www.domain.cn/public/
-rw-r--r--. fcgi fcgi unconfined_u:object_r:usr_t:s0 info.php
更改:
# sudo chcon -R -u system_u -t httpd_sys_content_t /www/
刷新浏览器,一切正常。
另外,尝试编译另外几个常用扩展,比如APCu、Phalcon等均报错不成功,第三方扩展还要跑步跟上啊,不然真升不上去,Redis、Memcache、SphinxSearch、Swoole等没有测试。