I finally completed porting my site to php using Yii and now that the site's deployed on my host's server, I'm noticing a problem with accessing certain controllers in the admin section.
The url I’m trying to access is like the following: http://mydomain.com/…somethingsitems
The controller 'SomethingsItemsController' is found under the 'admin' directory.
I get a blank page. I'm unable to access the php error log to debug this on the hosted server. This problem doesn't afflict my local development environment. Perhaps it's related to case-sensitivity on the server?
Anyone else see similar behavior?
Also… I do have caseSensitive of the urlManager set to false.
Yes, it's related with case-sensitivity. You need to use admin.somethingsItems as the route.
That doesn't work. I'm still left with a blank page.
Sorry, my judgement was not completely right. I think there's something else wrong because if the controller cannot be found, you should still see an error page displayed by Yii. A blank page normally means you have some PHP error or warnings and you turn off the error display. You should check the error log, turn on error_display, or insert some die() statements to debug your application.
Currently the error logs I have access to, don't show any errors for today. Also, I did do some basic debugging by commenting out code in the affected controller's actions and echoing a statement to see if at least the controller is being called. It's not. I'll try and turn on error display for only the admin and see what I get out of that.
Actually that won't work since I need to do that from the index page. The problem is I don't have direct access to the actual php error log and this problem is only on my production site, so I can't debug this on my local development site. There's no way I'm going to turn on error display on a production site.
The yii log doesn't show any problems. I've contacted my host to verify whether or not I'll find PHP errors in the error log I have access to. I'll let you know what comes out of this communication.
Another problem that I can think of is the write permission for directory assets and runtime.
No, the permissions for those directories are fine.
I tried something and now I'm really confused.
I originally thought it had something to with Yii getting confused because of controllers with similar names… example:
I can access the following fine:
This I can't:
So… I changed the name of the file to
and the name of the class to
thinking that I shouldn't have a problem accessing it with the new name, so I tried accessing:
Both, loaded a blank page.
So far no word from my host's support team.
I'm just noticing now that the blank page has the title of "CException".
Ok, it had that title when I renamed the file/class to ItemsController. Now that it's back to SomethingItemsController, it no longer has that title.
Perhaps now, I have something to work with.
Ok, I found out what was causing the problem. Weird. I renamed the class and file from:
SomethingItemsController to SomethingitemsController
Now the controller loads no problem. Weird that renaming it to ItemsController didn't work though.
Well, this problem still exists. I have one controller that won't load, no matter what I rename it to. Even names that have absolutely no similarities to other controller names fail to load.
I even took it out of the subdirectory that it was in and tried to access it that way, still nothing. I checked the permissions. I checked the file encoding. I checked invisible characters. Nothing is different from other controllers other than the methods of course. This is simply mind-boggling.
What is the route in your URL? And what is your controller class name and file name?
Now I feel dumb. It was a syntax error. Missing parentheses.
Had I been able to access PHP error logs on my host's server, I would have gotten this a while ago.