这类问题得具体看报错的原因,查看server error_logcat /home/wwwlogs/gsl_api_error.log
报出:
`2018/03/13 19:04:38 [error] 13117#0: *1 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class ‘Yaf\Application’ not found in /home/www/serverList/api/index.php:5
Stack trace:
0 {main}
thrown in /home/www/serverList/api/index.php on line 5” while reading response header from upstream, client: 10.0.2.2, server: gsl-local-api.gaeamobile.net, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “gsl-local-api.gaeamobile.net”`
在网上搜索的解决办法并不适用,
php -m
查看已经加载yafphp -i | grep yaf
已经开启,并没有打开yaf.use_namespace
最后定位在php.ini上
添加如下:
yaf.use_spl_autoload = On
yaf.environ = "develop"
yaf.use_namespace = On
重启php-fpm