# Yii Framework Forum: Autoload Not Working On Windows Development Machine With Php Built-In Webserver? - Yii Framework Forum

Page 1 of 1

## Autoload Not Working On Windows Development Machine With Php Built-In Webserver? Rate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.yiiframework.com/forum/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=36549&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1CodeButterfly

• Junior Member
• Group: Members
• Posts: 51
• Joined: 30-August 12

Posted 12 October 2012 - 07:24 PM

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:

Yii::setPathOfAlias('common','c:\path\to\webroot\common');

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?
0

### #2CodeButterfly

• Junior Member
• Group: Members
• Posts: 51
• Joined: 30-August 12

Posted 12 October 2012 - 09:51 PM

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

common/config/main.php

and

frontend/config/main.php

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.
0