Linux-chmod command after installing PHP application hint file is still not writable

Source: Internet
Author: User
I want to install some open source PHP applications under my Linux system, such as Phpfreechat, I put it under/var/www/html/freechat, The public and private folders in the Data folder under Freechat are then used chmod 777command, and then use the ls -al datacommand to see the result:

drwxr-xr-x. 4 root root 4096 June 17 15:07.
Drwxr-xr-x. Root root 4096 June 17 15:22.
Drwxrwxrwx. 2 root root 4096 June 15:07 private
Drwxrwxrwx. 3 root root 4096 June 15:07
Public

But typing http://localhost/freechat in the browser will get this error:

Phpfreechat cannot is 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

Also tried to use recursive chmod command, the error is still.

Using code

 
  

Discover that the username is Apache, and then found in/etc/httpd/conf/httpd.conf that both user and group are Apache. The reason why the display file is not writable because of this user's setup problem? If so, how do I change it? If not, what is the problem?

Reply content:

I want to install some open source PHP applications under my Linux system, such as Phpfreechat, I put it under/var/www/html/freechat, Then use the command for public and private folders in the Data folder under Freechat chmod 777 , and then use the ls -al data command to see the result:

drwxr-xr-x. 4 root root 4096 June 17 15:07.
Drwxr-xr-x. Root root 4096 June 17 15:22.
Drwxrwxrwx. 2 root root 4096 June 15:07 private
Drwxrwxrwx. 3 root root 4096 June 15:07
Public

But typing http://localhost/freechat in the browser will get this error:

Phpfreechat cannot is 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

Also tried to use recursive chmod command, the error is still.

Using code

 
  

Discover that the username is Apache, and then found in/etc/httpd/conf/httpd.conf that both user and group are Apache. The reason why the display file is not writable because of this user's setup problem? If so, how do I change it? If not, what is the problem?

Problem solved, unexpectedly is selinux obstruction. setenforce 0after use, it succeeds.

That's why you should try it. chown -rf apache.apache /var/www/html/freechat/data/

chmod 777-r/var/www/html/freechat/data

Recursive Modify Permissions
Or to @joyqi, change the directory owner to Apache.

Chown-r Apache:apache/var/www/html/freechat

RPM system must remember Setenforce 0, temporarily shut down selinux and then test

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.