yii framework PHP User Error - The directory is not writable by the Web process

0

I am facing an issue with YII Framework on Server Red Hat Enterprise Linux Server release 7.2 (Maipo)

PHP Version:

# php -v

Output:

PHP 7.0.5 (cli) (built: Apr  2 2016 13:08:13) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies    

Permission:

#chmod -R 777 /var/www/html/backend/web/assets

Error:

PHP User Error – yii\base\ErrorException

Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory is not writable by the Web process: /var/www/html/backend/web/assets' 

in /var/www/html/vendor/yiisoft/yii2/web/AssetManager.php:213

Solutions Already tried: https://stackoverflow.com/questions/34482597/yii2-the-directory-is-not-writable-by-the-web-process-frontend-web-assets

$ps -ef | grep apache | grep -v grep  

Output:

apache   14041 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   14042 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   14043 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   14044 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   14045 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   14046 14040  0 06:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

The same thing working fine with Centos, Ubuntu and other OSes but on Red Hat problem is still there.

Ramesh Chand

Posted 2016-05-05T12:14:22.463

Reputation: 101

Does the error still occur if you suspend the httpd service before running chmod? – Burgi – 2016-05-05T13:32:53.810

Yes Burgi the error still occurring. – Ramesh Chand – 2016-05-05T15:07:15.640

Answers

1

According to your question, the command you have typed is:

#chmod -R 777 /var/www/html/backend/web/assets

Since you want to change the permission of that folder, you need to have a elevated user privileges. Hence append sudo before your query to provide the elevated user privileges to the command and to change the directory permissions

user876616

Posted 2016-05-05T12:14:22.463

Reputation: 11