The solution to the problem that the php project under centos does not have permissions is: first enter the nginx directory and open the configuration file; then modify [fastcgi_param PHP_ADMIN_VALUE]; and finally restart the nginx server.
The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.
Under the centos system, our php project does not have permissions. Why is this? The reason is actually very simple, because our website directory points to public.
So how do we solve this problem? Let us take a look at the solution below.
Solution:
First cd to the nginx directory, open fastcgi.conf
Then edit the configuration file
vim /usr/local/nginx/conf/fastcgi.conf
Last modification (yy pCopy the line)
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
Change to
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
Restart ngnix or lnmp
Related video sharing: php video Tutorial
The above is the detailed content of What should I do if the php project under centos does not have permissions?. For more information, please follow other related articles on the PHP Chinese website!