Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phalcon tutorial error PhalconException: TestController handler class cannot be loaded

I'm having some trouble getting Phalcon Tutorial 1 to work. In the end I've cloned the version of it onGithub to make sure I'm not missing something; still getting the same behavior from that.

Pointing the browser to localhost/test as shown in the tutorial gives: `

"PhalconException: TestController handler class cannot be loaded".

Going to localhost/test.php, however, loads the "Hello!" test message correctly.

Phalcon is shown in phpinfo() and get_loaded_extensions().

I get this behaviour even having cloned the tutorial from

https://github.com/phalcon/tutorial .

My guess is that apache is not re-writing URLs correctly, as described at Phalconphp routes not working , but my problem doesn't seem to the same as the one there.

Contents of htaccess files:

#/tutorial/.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>

and

#/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>
like image 778
MHG Avatar asked Dec 15 '22 02:12

MHG


1 Answers

Replace in bootstrap file index.php

$url->setBaseUri('/tutorial/');

with

$url->setBaseUri('/');
like image 155
Marcone Avatar answered Mar 01 '23 23:03

Marcone