我想要在自己的Linux系统下安装一些开源的php应用,譬如phpFreeChat,我把它放在/var/www/html/freechat底下,然后对freechat下的data文件夹中的public和private文件夹使用了chmod 777
命令,然后使用ls -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
但是在浏览器里输入http://localhost/freechat 却会得到这样的错误:
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
还尝试过用递归的chmod命令,错误依旧。
利用代码
<?php echo exec('whoami'); ?>
发现用户名是apache,然后在/etc/httpd/conf/httpd.conf里发现User和Group都是apache。请问之所以显示文件不可写是因为这个用户的设置问题吗?如果是的话我该怎么修改?如果不是的话又是什么问题导致的呢?