Autoload Not Working On Windows Development Machine With Php Built-In Webserver?

Been testing yii on my unix-based webhost which works fine. Now in the progress of setting up my local development environment. I’m using Netbeans with PHP 5.4 on Windows 7. I’m using the built-in PHP webserver. I can serve my home page fine. However I’m getting errors when trying to access my controllers that reference models classes in my common/models folder, for example:

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

I am using the project directory structure described in The directory structure of the Yii project site wiki article by Qiang

I’m thinking it might possibly have to do with the following line in my main.php:


I’ve tried a relative line as well:

Yii::setPathOfAlias('common', dirname(__FILE__).'/../../common');

I’m wondering if there is some trick with file paths on windows or else if I need to enable some php extension? Or any other ideas?

I believe I found the issue. Because I was using the more complicated project structure I have the "common" alias defined in both:




I had changed it to be a valid path for my development machine in common/config/main.php but not in frontend/config/main.php. Adding it to frontend config solved the problem. Still new to this project structure so perhaps I don’t need the call to Yii::setPathOfAlias(‘common’… in the frontend config at all.