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

introduction

project cannot be accessed after porting to the new VPS. Error message:
Warning: Unknown: failed to open stream: Permission denied in on line 0
Fatal error: Unknown: Failed opening required ‘/ var/WWW/project/index. PHP’ (include_path = ‘. :/usr/share/PHP ‘) in the Unknown on line 0

solution

key information: failed to open stream — Permission denied Permission

reason: the project folder as a whole does not have read/write permissions, so PHP cannot parse

solution:

cd /var/www/project/

sudo chmod -R 0755 ./

is the same as 0755 or 0777

Read More: