Вопрос

I have my Yii application worked well on Windows Server. But when I deploy it on Centos server, the js and css files cannot be loaded. I got 404 error, CHttpException.

Source code to load resource:
     Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl.'/css/custom.css');
     Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl.'/js/jquery-1.7.1.min.js');

In addition, I have 4 Yii web applications deploy on the same server. And the other ones work well. Does anyone know the reason why? Can it be a security error on Centos that does not publish themes folder?

Please help me on this.

TIA,

Это было полезно?

Решение

I think it's permissions problem. Check permissions of your files and folders (can web-server process access them)

Другие советы

Got it solved. I guess it because of file permission. - The first time I create a folder, copy source file then grant permission for web-server user. It does not work as above. - 2nd time: I create rootdocument, grant permission for web-server user and then copy source, it works.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top