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

How to solve the problem of unwritable php files

藏色散人
Release: 2023-03-04 21:46:01
Original
3300 people have browsed it

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


##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/
Copy after login
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 .
Copy after login

##/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!

Related labels:
php
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