Home >PHP Framework >YII >What should I do if the yii asset folder cannot be accessed?

What should I do if the yii asset folder cannot be accessed?

藏色散人
藏色散人Original
2020-07-20 10:19:482840browse

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.

What should I do if the yii asset folder cannot be accessed?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn