Home> PHP Framework> YII> body text

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

藏色散人
Release: 2020-07-20 10:19:48
Original
2738 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
yii
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!