Home >Backend Development >PHP Problem >How to solve the problem of unwritable php files

How to solve the problem of unwritable php files

藏色散人
藏色散人Original
2020-08-21 10:05:473314browse

The php file cannot be written because the default user and group of "apache (httpd)" are both "daemon". The solution is: 1. Modify the user and group; 2. Modify the permissions of other users to be able to Write and read.

How to solve the problem of unwritable php files

Recommended: "PHP Video Tutorial"

The directory running php on Linux cannot be written Problem

The reason is that the default user and group of apache (httpd) are both daemon

The default user of nginx is nginx

Application directory user and group Caused by incorrect settings!

Solution:

1. Modify the user and group (suggestion)

2. Modify the permissions of other users to write and read

Example: When uploading a thinkphp to generate an application directory for the first time, it prompts that it is not writable

Application directory [./Application/] is not writable and the directory cannot be automatically generated!

Please generate the project directory manually~

As shown:




Check Application attributes are as follows:

ls -l


##View httpd users and groups

phpinfo(); Print information search'

User/Group'


##apache View httpd.conf


##nginx View nginx.conf


Just modify it accordingly. For example, I am currently starting apache, and I changed the project to daemon user and daemon group

chown -R daemon:daemon shopping/
View:

Visit:

I will delete the relevant files just generated and delete the user Change the group from daemon to root, and solve it by changing file permissions:

Recurring problem:

Access: I configure port 82 nginx

chmod 777 -R .

##/END

The above is the detailed content of How to solve the problem of unwritable php files. 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