PHP错误 Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error:

邓阳嘉
2023-12-01

前言

项目移植到新的VPS后访问不了,错误信息:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required '/var/www/project/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
 

解决

关键信息:failed to open stream 打不开流/文件 -- Permission denied 权限 拒绝

原因:项目文件夹总体没有读写权限,造成PHP无法解析

解决办法:

cd /var/www/project/

sudo chmod -R 0755 ./

就是统一权限为0755或者0777

 类似资料: