Skip to content
Advertisement

Apache does not have write permission on html folder

I installed apache, MySQL, PHP in CentOS 7. All work well, except apache cannot write file in html folder. I found this problem when I used file_put_contents. I tried

  1. Change owner of /var/www to apache:apache, not work
  2. Added Order allow,deny Allow from all to <Directory "/var/www/html"> in httpd.conf, restart httpd service, not work
  3. chmod -R 0777 /var/www/html, not work

What is wrong with my server? Please help me!

UPDATE1: result of ls -al /var/www/html

JavaScript

UPDATE 2: apache error_log (I changed all IP address) – Edited, change to new error_log, after stop httpd, backup error_log, start httpd

JavaScript

Advertisement

Answer

Thank all guy! I fixed my problem with this guide:

http://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/

I hope it will be helpful.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement