Home > Backend Development > PHP Problem > 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?

王林
Release: 2023-03-10 21:46:01
Original
2408 people have browsed it

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
Copy after login

Last modification (yy pCopy the line)

 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
Copy after login

Change to

 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
Copy after login

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!

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