Home >PHP Framework >YII >What should I do if the yii asset folder cannot be accessed?
The solution to the inaccessible yii file: first permanently close selinux; then open the "selinux/config" file; then change "SELINUX=enforcing" to "SELINUX=disabled"; and finally restart.
The problem that the asset folder of yii2 cannot be accessed
A www server has not been accessed for some days, suddenly An inexplicable problem arises.
You can log in to the backend, but some pages in the backend cannot be accessed. The prompt is:
There is no write permission to the assets folder.
It doesn’t work no matter how you pass the following command
chmod -R 777 assets chown -R www:www assets chown -R apache:apache assets
Through the is_writable function test of php, it is found that the
/var/lib/php/session folder is writable
So I created the same permissions and groups as this folder, but the assets still cannot be accessed. Strange...
The problem was finally solved. It was a problem with CentOS's SELinux.
Just turn off selinux permanently.
But I still don’t know the reason for the strange phenomenon that some can be written and some cannot be written.
vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled
You need to restart after setting to take effect.
Recommended: "yii tutorial"
The above is the detailed content of What should I do if the yii asset folder cannot be accessed?. For more information, please follow other related articles on the PHP Chinese website!