Home > Backend Development > PHP Problem > How to solve the problem that linux php cannot be written

How to solve the problem that linux php cannot be written

藏色散人
Release: 2023-03-12 22:54:01
Original
2366 people have browsed it

linux php cannot be written because the user and group of the Application directory are not set correctly. The solution is: 1. Modify the user and group; 2. Modify the permissions of other users to be writable and readable.

How to solve the problem that linux php cannot be written

The operating environment of this article: Windows 7 system, PHP version 5.6, DELL G3 computer.

How to solve the problem that linux php is not writable?

The directory running php on linux is not writable

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

The default user of nginx is nginx

Application directory user and group are not set correctly!

Solution:

1. Modify the user and group (recommendation)

2. Modify the permissions of other users to writable Read

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

The 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

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve the problem that linux php cannot be written. 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