美文网首页
PHP Fatal error: Uncaught excep

PHP Fatal error: Uncaught excep

作者: sun_wenming | 来源:发表于2017-10-11 16:45 被阅读0次

    在contos系统下。使用的为thinkphp框架Apache/2.4.7 (Unix) PHP/5.5.10

    安卓发起请求。
    500 Internal Server Error 但是 数据却正常返回

    首先在/phpstudy/server/httpd/logs/error_log 文件中 查看错误详情

    错误很长截取了重要部分

    PHP Fatal error:  Uncaught exception 'think\\exception\\ErrorException' with message 'error_log(/phpstudy/www/SwmSignPhp/runtime/log/201710/11.log): 
    failed to open stream: Permission denied' in /phpstudy/www/SwmSignPhp/thinkphp/library/think/log/driver/File.php:116\nStack trace:\n#0 [internal function]: 
    

    大致意思为,PHP致命错误:没有权限在ThinkPHP框架中,写入log日志。
    /phpstudy/www/xxx项目名/runtime/log/201710/11.log)

    使用 WinSCP 查看相应目录下后面的权限

    缺少写入权限.png

    知道了问题根源,我们就来修改吧。

    Linux添加目录权限命令:

    chmod o+w /phpstudy/www/xxx项目名/runtime

    即可正常。权限参考CentOS下查看以及修改文件权限

    相关文章

      网友评论

          本文标题:PHP Fatal error: Uncaught excep

          本文链接:https://www.haomeiwen.com/subject/oovwyxtx.html