cakephp 元素 MissingViewException

发布于 2024-12-11 20:57:57 字数 1059 浏览 6 评论 0原文

当我将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无声无音无过去 2024-12-18 20:57:57

正如我在评论中所写,错误是我在 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文