致命错误:"Phalcon \ Http \ Client \ Request"类 [英] Fatal error: Class 'Phalcon\Http\Client\Request'
本文介绍了致命错误:"Phalcon \ Http \ Client \ Request"类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请求时出错
致命错误:在第41行的ControllerBase.php中找不到类'Phalcon \ Http \ Client \ Request'
Fatal error: Class 'Phalcon\Http\Client\Request' not found in ControllerBase.php on line 41
use Phalcon\Http\Client\Request as CRequest;
$provider = CRequest::getProvider();
$provider->setBaseUri('http://localhost/testing');
推荐答案
您需要从下载,然后将全部或仅HTTP目录复制到您的/app/library/文件夹中.在您的public/index.php中,将$ loader-> registerNamespaces添加到孵化器库的正确路径.
You will need to a copy of the incubator library files from the Phalcon/Incubator github. Download and copy all or just the HTTP directory to your /app/library/ folder. In your public/index.php, add $loader->registerNamespaces with the correct path to the incubator library.
$loader = new Phalcon\Loader();
$loader->registerNamespaces(array(
'Phalcon' => APP_PATH . 'app/library/'
));
$loader->register();
来源: https://github.com/phalcon/incubator#autoloading-来自孵化器
这篇关于致命错误:"Phalcon \ Http \ Client \ Request"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文