I want to install some open-source php applications in my Linux system, such as phpFreeChat. I put it under varwwwhtmlfreechat, then, use the chmod777 command for the public and private folders in the data folder under freechat, and then use ls-aldata... I want to install some open-source php applications in my Linux system, such as phpFreeChat. I put it under/var/www/html/freechat, then, the public and private folders in the data folder under freechat are used.
chmod 777
Command, and then use
ls -al data
Command to see the result:
Drwxr-xr-x. 4 root 4096 Jun 17 :07.
Drwxr-xr-x. 13 root 4096 Jun 17 :22 ..
Drwxrwxrwx. 2 root 4096 Jun 17 :07 private
Drwxrwxrwx. 3 root 4096 Jun 17 :07 public
However, entering http: // localhost/freechat in the browser will result in the following error:
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
You have also tried the recursive chmod command, and the error persists.
Use code
The User name is apache, and then the User and Group are both apache in/etc/httpd/conf/httpd. conf. Is the reason why the display file cannot be written is that this user's settings are incorrect? If so, how can I modify it? If not, what is the problem?
Reply content:
I want to install some open-source php applications in my Linux system, such as phpFreeChat. I put it under/var/www/html/freechat, then, the public and private folders in the data folder under freechat are used.chmod 777
Command, and then usels -al data
Command to see the result:
Drwxr-xr-x. 4 root 4096 Jun 17 :07.
Drwxr-xr-x. 13 root 4096 Jun 17 :22 ..
Drwxrwxrwx. 2 root 4096 Jun 17 :07 private
Drwxrwxrwx. 3 root 4096 Jun 17 :07 public
However, entering http: // localhost/freechat in the browser will result in the following error:
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
You have also tried the recursive chmod command, and the error persists.
Use code
The User name is apache, and then the User and Group are both apache in/etc/httpd/conf/httpd. conf. Is the reason why the display file cannot be written is that this user's settings are incorrect? If so, how can I modify it? If not, what is the problem?
After the problem is solved, it turns out that SELinux is stuck in the middle. Usesetenforce 0
Then it will be successful.
This is the reason.chown -rf apache.apache /var/www/html/freechat/data/
Try
chmod 777 -R /var/www/html/freechat/data
Recursively modify permissions
Or change the directory owner to apache as @ joyqi says.
chown -R apache:apache /var/www/html/freechat
You must remember to setenforce 0 in the Rpm system and temporarily disable selinux before testing.