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


yii framework

This error occurred because the references to the classes were not equal to the file name, but the application was always installed on Windows Server, which is not “case sensitive “, so it worked. The error appeared from the moment we put it on AWS with a Linux server, which is case sensitive.
But to find out what the problem was, I first had to do the steps below:

i have problem in using Yii 1.1 after generate the webapp using yiic. all controllers failed to loaded. After looking around the quick way to solve it is just add Yii::$enableIncludePath = false; in the index.php on the site root below the require_once($yii); statement. so the index.php should look like:

<?php
/**
* This is the bootstrap file for test application.
* This file should be removed when the application is deployed for production.
*/
// change the following paths if necessary
$yii = dirname(__FILE__) . '/../framework14/yii.php';
$config = dirname(__FILE__) . '/protected/config/test.php';

// remove the following line when in production mode
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, false);

require_once($yii);
Yii::$enableIncludePath = false;

Yii::createWebApplication($config)->run();

Reference: https://dawud135.wordpress.com/2014/06/21/yii-error-includecontroller-php-failed-to-open-stream-no-such-file-or-directory/


Moeda Tipo Valor
Dollar Compra R$ 5,59
Dollar Venda R$ 5,59
Data 06/06/2025

June 2025
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930