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 777
command, 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?
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 0
after 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