Home >Backend Development >PHP Problem >How to solve the problem of unwritable php files
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.
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
User/Group'
##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:
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!