I'm trying to get the tutorial working.
I'm getting an PhalconException: IndexController handler class cannot be loaded message
I have an alias set up as Alias /tutorial /opt/tutorial/public
When i accesst the page https://172.25.12.11/tutorial/ I get the error message.
mod rewrite is on. i have also tryed this in the main web dir with no change.
My file structure is
/opt/tutorial/
|-- .htaccess
|-- app
| \-- controlers
| \-- indexController.php -- (I have done upper and lower case i no change)
| |-- models
| \-- views
\-- public
|-- .htaccess
|-- css
|-- img
|-- index.php
\-- js
indexController.php file
<?php
class IndexController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
echo "<h1>Hello!</h1>";
}
}
index.php
<?php
try {
echo('1<br>');
//Register an autoloader
$loader = new \Phalcon\Loader();
$loader->registerDirs(array(
'../app/controllers/',
'../app/models/'
))->register();
echo('2<br>');
//Create a DI
$di = new Phalcon\DI\FactoryDefault();
echo('3<br>');
//Setup the view component
$di->set('view', function(){
$view = new \Phalcon\Mvc\View();
$view->setViewsDir('../app/views/');
return $view;
});
echo('4<br>');
//Setup a base URI so that all generated URIs include the "tutorial" folder
$di->set('url', function(){
$url = new \Phalcon\Mvc\Url();
$url->setBaseUri('/tutorial/');
return $url;
});
echo('5<br>');
//Handle the request
$application = new \Phalcon\Mvc\Application($di);
echo('6<br>');
echo $application->handle()->getContent();
echo('7<br>');
} catch(\Phalcon\Exception $e) {
echo "PhalconException: ", $e->getMessage();
}
Page output
1
2
3
4
5
6
PhalconException: IndexController handler class cannot be loaded
/tutoral/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
/tutorial/public/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>