Home > Article > PHP Framework > How to solve the problem of error 500 when Nginx deploys thinkphp
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!
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');
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!