Home  >  Article  >  CMS Tutorial  >  What to do if phpcms uploadfile cannot be written

What to do if phpcms uploadfile cannot be written

藏色散人
藏色散人Original
2020-01-15 09:18:372749browse

What to do if phpcms uploadfile cannot be written

What should I do if phpcms uploadfile cannot be written?

What to do if phpcms uploadfile cannot be written

1. Change the user and group belonging to the /var/www/html/phpcms directory to apache

[root@localhost html]# 
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ls 
index.php  itop  phpcms
[root@localhost html]# 
[root@localhost html]# chown -R apache:apache phpcms/
[root@localhost html]# 
[root@localhost html]#

2. Change /var/ All file permissions in the www/html/phpcms directory are set to 644, and directory permissions are set to 755

[root@localhost html]# 
[root@localhost html]# find phpcms/* -type f -exec chmod 644 {} \;
[root@localhost html]# find phpcms/* -type d -exec chmod 755 {} \;
[root@localhost html]#

3. Check the directory and file permission information under /var/www/html/phpcms

[root@localhost html]# 
[root@localhost html]# cd phpcms/
[root@localhost phpcms]# ls -lhd 
drwxr-xr-x. 9 apache apache 4.0K 1月   7 17:23 .
[root@localhost phpcms]# 
[root@localhost phpcms]# ls -lh
总用量 60K
-rw-r--r--.  1 apache apache   48 1月   7 00:46 admin.php
drwxr-xr-x.  3 apache apache 4.0K 1月   7 00:46 api
-rw-r--r--.  1 apache apache  991 1月   7 00:46 api.php
drwxr-xr-x. 17 apache apache 4.0K 1月   7 17:23 caches
-rw-r--r--.  1 apache apache  104 1月   7 00:46 crossdomain.xml
-rw-r--r--.  1 apache apache 3.1K 1月   7 00:46 favicon.ico
drwxr-xr-x.  2 apache apache    6 1月   7 17:20 html
-rw-r--r--.  1 apache apache 8.1K 1月   7 19:53 index.html
-rw-r--r--.  1 apache apache  318 1月   7 00:46 index.php
-rw-r--r--.  1 apache apache  523 1月   7 00:46 js.html
drwxr-xr-x. 10 apache apache 4.0K 1月   7 00:46 phpcms
drwxr-xr-x.  7 apache apache 4.0K 1月   7 00:46 phpsso_server
-rw-r--r--.  1 apache apache 3.6K 1月   7 00:46 plugin.php
-rw-r--r--.  1 apache apache  170 1月   7 00:46 robots.txt
drwxr-xr-x.  6 apache apache   51 1月   7 00:46 statics
drwxr-xr-x.  3 apache apache   19 1月   7 17:20 uploadfile
[root@localhost phpcms]# 
[root@localhost phpcms]#

4. Recheck "File Permission Settings" and it has passed

What to do if phpcms uploadfile cannot be written

PHP Chinese website, a large number of free PHPCMS tutorials, welcome online study!

The above is the detailed content of What to do if phpcms uploadfile cannot be written. 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