path: /var/www/html/ is writableby php
-
hi
im using dulicator to deploy some wordpress page
i prepair a virtual machine with centos 7 for hosting this site
and i prepair everything like lamp and configuring apache and phpmyadmin
but when i use http://ip address/installer.php dulicator says one requirement is nit ok and fails
root directory is failed .
in the details it says :
path :/var/www/html
[fail] is writable by phpi give the root dir every permission that needs
and i run this command
chown apache:apache -R /var/www/html
chmod 777 -R /var/www/htmli khow that 777 is not good but even by this permission it doesnt work
sorry about my bad english
-
The default user/group for Apache is
www-data. Unless you changed those values inhttpd.conf, you should use the following line to change ownership:chown -R www-data: /var/www/htmlNote that the above is correct; the group is optional if it is the same as the specified user.
There are much better solutions, such as using Apache’s
mpm_eventwith PHP-FPM. That will allow you to run PHP as a non-privileged user that has (S)FTP access, and PHP will run faster and with less memory usage.Thank you for your reply
I have checked the list of users and also httpd.conf and there is no such user i mean www-data in users of os and in httpd.conf user was apache.
I have didnt make change in httpd.confI have run your stated command “chown -R www-data: /var/www/html ” but it gives error “invalid user : www-data
If that is the case, then I suggest asking your question on stackexchange or serverfault since it doesn’t have anything to do with WordPress. Or hire someone to set up your server correctly.
I’ll add that it is unusual to have Apache run as the
apacheuser. That is how Apache worked in the old (2.0.x and 2.2.x) days. Modern versions of Apache run by default as thewww-datauser.Hi @mhtojv ,
The issue you are facing is due to SELinux.
By default the context set on ‘/var/www/html’ is:
# ls -ldZ /var/www/html
drwxrwxrwx. apache apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/You need to change the context for rw:
#chcon -Rv –type=httpd_sys_rw_content_t /var/www/html/
If file/directory permissions are fine then it should work.
Thanks.
-
This reply was modified 5 years, 4 months ago by
ashishprajapati149.
-
This reply was modified 5 years, 4 months ago by
The topic ‘path: /var/www/html/ is writableby php’ is closed to new replies.