Phalcon教程错误PhalconException:无法加载TestController处理程序类 [英] Phalcon tutorial error PhalconException: TestController handler class cannot be loaded
问题描述
在使Phalcon
教程1正常工作时,我遇到了一些麻烦.最后,我在Github
上克隆了它的版本,以确保没有丢失任何内容.仍然从中得到相同的行为.
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.
按照本教程中的说明将浏览器指向localhost/test可以得到:`
Pointing the browser to localhost/test as shown in the tutorial gives: `
"PhalconException: TestController handler class cannot be loaded".
但是,要转到localhost/test.php
,将加载"Hello!".正确测试消息.
Going to localhost/test.php
, however, loads the "Hello!" test message correctly.
Phalcon显示在phpinfo() and get_loaded_extensions()
中.
Phalcon is shown in phpinfo() and get_loaded_extensions()
.
即使从
https://github.com/phalcon/tutorial .
我的猜测是,如 所述,apache
无法正确重写URL. Phalconphp路由不起作用 ,但我的问题似乎与那里的问题不同.
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.
htaccess文件的内容:
Contents of htaccess files:
#/tutorial/.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>
推荐答案
替换为引导文件index.php
$url->setBaseUri('/tutorial/');
使用
$url->setBaseUri('/');
这篇关于Phalcon教程错误PhalconException:无法加载TestController处理程序类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!