Home>Article>Backend Development> How to solve php is_writable failure problem

How to solve php is_writable failure problem

藏色散人
藏色散人 Original
2021-09-15 11:19:54 2507browse

Solution to the failure of php is_writable: 1. Open the command window; 2. Execute "chcon -R -t httpd_sys_content_rw_t /var/www/html".

How to solve php is_writable failure problem

The operating environment of this article: centos7 system, PHP7 version, DELL G3 computer

How to solve the problem of php is_writable failure?

Specific problem description:

PHP7 is_writable always returns false!

My server is centos 7, and test.txt is just a test file I created on /var/www/html.

Permission is 766 1 root root test.txt

Modified nobody through chmod [Because php.net said that this function uses the identity of nobody for web access]

766 1 nobody root test.txt

The final result is that it can be written when compiling on the server, but cannot be written when accessing the web. How to do it?

How to solve php is_writable failure problem

Solution:

chcon -R -t httpd_sys_content_rw_t /var/www/html

Recommended study: "PHP Video Tutorial"

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