Reputation: 4814
Tried with the question but it didn't fix my issue. : Phalcon tutorial error PhalconException: TestController handler class cannot be loaded
My application is in AWS ubuntu 14.0 and some pages are working fine but for few pages, I'm getting this error:
PhalconException: NameController handler class cannot be loaded.
My controller names are CamelCase!
//Setup a base URI so that all generated URIs include the "tutorial" folder
$di->set('url', function(){
$url = new \Phalcon\Mvc\Url();
$url->setBaseUri('/');
return $url;
});
I changed my apache2.conf file to AllowOverride : all:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
My App is here projectname/admin/app/:
try {
//Register an autoloader
$loader = new \Phalcon\Loader();
$loader->registerDirs(array(
'../app/controllers/',
'../app/models/',
'../app/plugins/',
))->register();
cant able to debug this can anyone help what else could be the issue.?
Upvotes: 1
Views: 9997
Reputation: 769
I was getting this error so i fixed it in public/index.php
echo $application->handle($_SERVER['REQUEST_URI'])->getContent()
or echo $application->handle()->getContent()
or code related to this.$_SERVER['REQUEST_URI']
, it will also show the domain name.$request_uri=str_replace(["\n","\r","\t"], '', $_SERVER['HTTP_HOST']); if($request_uri=='localhost'){ $url=explode('/',$_SERVER['REQUEST_URI']); array_shift($url); array_shift($url); $url=implode('/',$url); $url='/'.$url; } else $url=$request_uri; echo $application->handle($url)->getContent();
OR Simply use /{controller name}/{function name}
in handle
function
$_SERVER['REQUEST_URI']
but we have to ignore domain name and redirect it to controller name.Upvotes: 1
Reputation: 1369
This simply means that such controller doesn't exists, like class isn't loaded.
Upvotes: 0
Reputation: 279
If the controller page is not present in controllers then this issue will come, so plz recheck the controller page exists or not.
Upvotes: 1