500 error problems and solutions

零下一度
Release: 2023-03-12 12:24:01
Original
7845 people have browsed it

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');
Copy after login

 

##3. Analyze the error content

Check the problem description and information and find 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 500 error problems and solutions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template