Home  >  Article  >  Backend Development  >  PHP project directory in nginx root directory, browser access reports 403 error

PHP project directory in nginx root directory, browser access reports 403 error

WBOY
WBOYOriginal
2016-08-18 09:16:241116browse

First of all, my running environment is Ubuntu14.04+Nginx1.4+MySQL5.6+PHP; secondly, the problem I am encountering now is that when my browser accesses the PHP project in the nginx root directory, a 403forbidden error is reported. However, accessing individual php files is no problem. Please give me some guidance

Reply content:

First of all, my running environment is Ubuntu14.04+Nginx1.4+MySQL5.6+PHP; secondly, the problem I am encountering now is that when my browser accesses the PHP project in the nginx root directory, a 403forbidden error is reported. However, accessing individual php files is no problem. Please give me some guidance

The index option of the server you did not set up with nginx does not have index.php (default file), so nginx treats your
request as access to the directory, and you have not set the permissions for directory access and you get a 403

nginx prohibits access to directory lists by default. If you need to access directory lists, you need to add autoindex on;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn