cakephp 元素 MissingViewException
当我将 cakePHP 2.0.0 应用程序上传到主机时,通过 ajax 调用函数时出现 MissingViewException。这将返回一个由元素创建的 json 对象。在我的本地 xampp 上,一切正常,但当我将其上传到我的主机 bytebob.com 时,出现异常。
我尝试对我的 .htaccess 进行更改,如高级 CakePHP 安装中所述 中所述页面,但它没有改变任何东西。
这是错误日志:
2011-10-25 18:26:04 Error: [MissingViewException] View file "/jalmar/app/View/elements/json.ctp" is missing.
0 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/View/View.php(363): View->_getViewFileName('/elements/json')
1 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/Controller/Controller.php(898): View->render('/elements/json', NULL)
2 /home/sites/jayar.dk/public_html/jalmar/app/Controller/AppController.php(22): Controller->render('/elements/json')
3 /home/sites/jayar.dk/public_html/jalmar/app/Controller/TilmeldingsController.php(147): AppController->sendJson(Array, Array)
4 [internal function]: TilmeldingsController->check_glogon()
主机正在将 php 作为 CGI 运行,但我不认为这是原因......
When I upload my cakePHP 2.0.0 app to my host I get a MissingViewException when I am calling an function via ajax. This returns an json object made by an element. On my local xampp everything is working fine, but when I upload it to my host, bytebob.com, I get the exception.
I have tried to make changes to my .htaccess like described in the advanced CakePHP installation page, but it doesn't change anything.
Here is the error log:
2011-10-25 18:26:04 Error: [MissingViewException] View file "/jalmar/app/View/elements/json.ctp" is missing.
0 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/View/View.php(363): View->_getViewFileName('/elements/json')
1 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/Controller/Controller.php(898): View->render('/elements/json', NULL)
2 /home/sites/jayar.dk/public_html/jalmar/app/Controller/AppController.php(22): Controller->render('/elements/json')
3 /home/sites/jayar.dk/public_html/jalmar/app/Controller/TilmeldingsController.php(147): AppController->sendJson(Array, Array)
4 [internal function]: TilmeldingsController->check_glogon()
The host is running php as a CGI, but I don't think that is the reason...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我在评论中所写,错误是我在 AppController 中用小写 e 编写了元素的路径。这在我的本地主机上作为 Windows 工作,但在我的使用 unix 的主机上不起作用......我以为我尝试过更改它,但显然没有。
由于这是我关于堆栈溢出的第一个问题,所以我可以接受自己的答案来结束问题吗?
As I wrote in the comments, the error was that I had written the path to elements with a lowercase e in my AppController. This worked on my localhost as a windows, but not in my host using unix... Thought I had tried to change it but apperently not.
As this is my first question on stack overflow, so is okay that I accept my own answer to close the question?