Home  >  Article  >  Backend Development  >  What should I do if the php project under centos does not have permissions?

What should I do if the php project under centos does not have permissions?

王林
王林Original
2021-06-25 14:51:492375browse

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.

What should I do if the php project under centos does not have permissions?

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

What should I do if the php project under centos does not have permissions?

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!

Statement:
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