Probably this is an easy one but I am just not able to figure this out for a few days now.
Yii autoload model is not working for me on linux,
Now on windows everything is working fine,
but on linux I get for example a php warning: "include(UserIdentity.php) Failed to open stream: No such file or directory".
This happens when I try to login.
This error occurs for any model / component / extension which Yii tries to load.
The only solution that worked for me was to modify the import array to specify every single file to include:
But this does not make any sense because in older Yii distros I had no issues like this one and it makes me include a million files manually.
non the less, UserIdentity.php is generated automatically by Yii so the naming should be fine.
I also verified that the class names and file names match (case sensitive).
I am using Yii 1.1.14 on centos 5.9 with apache.
Can it be related to server configuration?
Any ideas would be very much appreciated!
Thank you so much!
If somthing works on windows but not on *nix, it’s always the case-sensitiveness.
The question is, where did you miss it.
What’s the full path to UserIdentity.php?
Hi, Thank you for your reply,
The full path is:
and the class name is: "class UserIdentity"
I am sitting with the same problem. Seems like my only solution will be to change all my URL’s to the correct controller name case.
This kind of reminds me why I LOVE doing Java development. CODE ONCE RUN ANYWHERE
What do you mean by “change all my URL’s to the correct controller name case” ?
How will it affect to auto loading of models / classes?
I think my problem is different, but comes down to the same issue.
My controller classes are for example named:
My URL’s are for example:
Linux cannot find the url because the cases are not the same. I have to change all my URL’s to match the controller case. Example URL: MyLoginController/login
When I do that, Linux is happy.
Anyone else has an idea?
I guess I’m going to have to move this post to stack exchange, if a solution comes up I’ll post it here…
Long shot but make sure that the component class name is the same as the filename it sits in and the only difference is the addition of ".php" suffix to the filename.
Double check character-cases including all your usage of the classes (where you call/instantiate them). They should all ‘sing the same song’… .