yii move to nginx

Hi, I am trying to move a website using yii framework (that I didn’t make) to a server running nginx.

I’ve look for a solution but everything seems fine in the configs etc. I get the message;

include(Controller.php): failed to open stream: No such file or directory

Stacktrace:

#0 /data/www/presentationproducts.nl/public_html/framework/YiiBase.php(432): YiiBase::autoload()

#1 unknown(0): YiiBase::autoload("Controller")

#2 /data/www/presentationproducts.nl/public_html/protected/controllers/SiteController.php(4): spl_autoload_call("Controller")

#3 /data/www/presentationproducts.nl/public_html/framework/web/CWebApplication.php(354): require("/data/www/presentationproducts.nl/public_html/protected/controll…")

#4 /data/www/presentationproducts.nl/public_html/framework/web/CWebApplication.php(276): CWebApplication->createController("")

#5 /data/www/presentationproducts.nl/public_html/framework/web/CWebApplication.php(141): CWebApplication->runController("")

#6 /data/www/presentationproducts.nl/public_html/framework/base/CApplication.php(185): CWebApplication->processRequest()

#7 /data/www/presentationproducts.nl/public_html/index.php(26): CApplication->run()

I don’t have any experience with yii and I am not sure how to fix this and which files to check further.

The .htaccess file has a rule that may be of relevance (Also didn’t do all too much with these);

RewriteRule ^([^/].*)$ /index.php/$1 [L]

This obviously used to run on apache, any ideas?

This is in the config main for autoloading;

'import' => array(


    'application.models.*',


    'application.helpers.*',


    'application.components.*',


    'ext.giix-components.*',


    'ext.LessCss.*',


    'ext.editMe.helpers.ExtEditMeHelper'


),

I use nginx and php-fpm exclusivly and it kicks butt!

Search the forum here. There are other posts regarding setting up nginx for YII2.

Nginx does not use .htaccess. So anything you are using there will need to be redone.

post your nginx config file for your site and we can compare notes.

Before posting make sure there is not any secrets in it.

I know nginx doesn’t use htaccess, what I meant is that I have to get the same functionalities when moving the website as it works on apache and this seemed to be the only htaccess rule that might matter.

The only solution i could find to


include(Controller.php): failed to open stream

was to add


'application.components.*',

to the config/main.php. But it’s already there, also the file is really there.

EDIT: This is the code of the Controller, it’s a custom controller. Please note i didn’t make this website I just need to move it.


<?php

/**

 * Controller is the customized base controller class.

 * All controller classes for this application should extend from this base class.

 */

class Controller extends CController

{

    /**

     * @var string the default layout for the controller view. Defaults to '//layouts/column1',

     * meaning using a single column layout. See 'protected/views/layouts/column1.php'.

     */

    public $layout = '//layouts/main';

    public $headertext = 'home';

    public $bodyclass = array();

    public $meta_tags = '';

    public $meta_description = '';


    public function pagetitle($title)

    {

        $this->pagetitle = $title . " | " . Yii::app()->name;

    }


    public function init()

    {

        $cs = Yii::app()->getClientScript();


        //JS

        //     $cs->registerScriptFile('/src/dashboard/js/blocks/databox.js');

        $cs->registerScriptFile('/src/site/js/default.js');


        //CSS

        $cs->registerCSSFile(LessCss::getCssUrl('src/site/css/site.less', false), 'screen, projection');


        $cs->registerCoreScript('jquery');

    }


    /**

     * @var array context menu items. This property will be assigned to {@link CMenu::items}.

     */

    public $menu = array();

    /**

     * @var array the breadcrumbs of the current page. The value of this property will

     * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}

     * for more details on how to specify this property.

     */

    public $breadcrumbs = array();

}