Home > PHP Framework > ThinkPHP > body text

How to solve the problem of error 500 when Nginx deploys thinkphp

藏色散人
Release: 2021-05-12 09:04:01
forward
2630 people have browsed it

The following tutorial column of thinkphp will introduce to you how to solve the problem of error 500 when deploying thinkphp in Nginx. I hope it will be helpful to friends in need!

How to solve the problem of error 500 when Nginx deploys thinkphp

I started a new project today. After the lnmp installation was completed, when I deployed the project directory, I kept getting an error 500
After I found many reasons, I thought lnmp Installation error
Finally found that it seems not
Add these two sentences in the entry file index.php

error_reporting(E_ALL);
ini_set('display_errors', '1');
Copy after login

You will find the error message

See this error message It is very clear that this is because php cannot introduce files above and above its authorization directory due to open_basedir configuration problems.
Find the nginx configuration file fastcgi.conf, find the parameter fastcgi_param PHP_ADMIN_VALUE, and add the path to the string of this parameter
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/mnt/hgfs /phpworkspace/:Site deployment path";

Related recommendations:The latest 10 thinkphp video tutorials

The above is the detailed content of How to solve the problem of error 500 when Nginx deploys thinkphp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!