Home > Article > Backend Development > Detailed explanation of the file permissions issue of the open_basedir configuration item
1. Foreword
Today I installed the lnmp environment in Ubuntu. When running the project, a 500 error occurred
2. Check the error
Add it to the project file entry, the code displays the error content, and check the error
ini_set('display_errors','yes');
3. Analyze the error content
After checking the problem description and information, I found that it is a problem with the php open_basedir configuration. PHP cannot introduce its authorization directory superior and The above files are configured in php.ini (/usr/local/php/etc/php.ini) by default, but my open_basedir is not configured and is commented out by default.
The literature said that it may be in the server configuration directory, such as nginx, Apache, etc., so the user sublime opened nginx to conduct a global search, open_base, and it was found, as shown below
4. Modify the configuration
Line 27 is the default configuration. The default configuration is the permission directory under the nginx.conf root file
Line 27 I copied a line Change the authorization directory to the superior of the project folder, restart nginx, and the project can be opened.
5. Summary
It is the file permission problem of the open_basedir configuration item, if you also encounter it In this case, check the configuration files of php.ini server nginx and Apache.
The above is the detailed content of Detailed explanation of the file permissions issue of the open_basedir configuration item. For more information, please follow other related articles on the PHP Chinese website!