Linux – File still unwriteable in /var/www/html after the chmod command

chmodfile-permissionshttpdlinuxPHP

I've got some trouble while trying to install some applications on my linux system. It is said that the files in my /var/www/html/xxx directory, where I put them, is not writeable. The command chmod 777 xxx has been tried to make it work, but the error remains when I opened the applications again.

To be specific, I want to install phpFreeChat on my system, so I put those files in the /var/www/html/freechat directory, cd there and typed chmod 777 data/private, chmod 777 data/public on bash. Here's the result of list -al data:

drwxr-xr-x.  4 root root 4096  Jun 17 15:07 .
drwxr-xr-x. 13 root root 4096  Jun 17 15:22 ..
drwxrwxrwx.  2 root root 4096  Jun 17 15:07 private
drwxrwxrwx.  3 root root 4096  Jun 17 15:07 public

These all seemed all right to me, until I typed http://localhost/freechat in my browser. Here's the result:

phpFreeChat cannot be initialized,
please correct these errors:

/var/www/html/freechat/src/../data/private
is not writeable
/var/www/html/freechat/src/../data/private/cache
can't be created
/var/www/html/freechat/src/../data/private/cache
is not writeable
/var/www/html/freechat/src/../data/private/cache
is not readable cannot create
/var/www/html/freechat/src/../data/public/themes/default
cannot create
/var/www/html/freechat/src/../data/public/themes/default
/var/www/html/freechat/src/../data/private/chat
can't be created
/var/www/html/freechat/src/../data/private/chat
is not writeable
/var/www/html/freechat/src/../data/private/chat
is not readable
/var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada
can't be created
/var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada
is not writeable
/var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada
is not readable

I'm quite confused with this because this situation did not only happen in the installation of this application but all. Mistakes must be made by me, but what is it?

Best Answer

This problem has been settled by command setenforce 0, which would shut down SELinux.

How silly I am! I never thought about this stuff.

Thanks Flimzy and njd anyway.

Related Question