简体   繁体   English

CakePHP无法在实时服务器上呈现某些控制器的视图

[英]CakePHP not rendering views for some controllers on live server

I have a problem, that I can't figure out. 我有一个问题,我不知道。

I made an app with CakePHP that work's perfectly fine on localhost (via XAMPP), but has strange issue on live server. 我使用CakePHP了一个应用程序,该应用程序在localhost(通过XAMPP)上运行正常,但在实时服务器上却出现了奇怪的问题。
There are (obviously) many controllers in my app, and the problem is - some of them are not rendering any view whatsoever! 我的应用程序中(显然)有许多控制器,问题是-其中一些控制器未呈现任何视图! They output neither proper content, nor any error data - simply empty page (no layout either). 它们既不输出适当的内容,也不输出任何错误数据-只是空页(也没有布局)。 About half of them is working fine, and the other half - not. 他们中大约有一半工作正常,而另一半-没问题。

I have no idea what might that be, so that's why I'm here - any ideas? 我不知道那会是什么,所以这就是为什么我在这里-有什么想法吗?

This may be an old thread, but I'm replying this as a possible answer and solutions for other people who might have the same problem. 这可能是一个旧话题,但我将其作为对可能有相同问题的其他人的可能答案和解决方案进行答复。

  1. What you should do when you have this problem is to check the error log inside /app/tmp/logs . 遇到此问题时,您应该做的是检查/app/tmp/logs的错误/app/tmp/logs From there you can perhaps see what cause the error. 从那里您也许可以看到导致错误的原因。

  2. Make sure your debug is set to 2 for all error reporting to be displayed if any. 确保将调试设置为2 ,以显示所有错误报告(如果有)。 The debug can be turned on in app/Config/core.php . 可以在app/Config/core.php打开调试。

  3. From the logs, you might see the error is with the maximum memory reached. 从日志中,您可能会看到错误是达到最大内存。 For this, you'll need to fix your code and optimize it. 为此,您需要修复代码并对其进行优化。

  4. Please check if your URL rewriting mod_rewrite is enabled in your live server. 请检查您的实时服务器中是否启用了URL重写mod_rewrite Some server might require you to set it up yourself. 某些服务器可能会要求您自行设置。

A piece of advice, always check with your error logs, it always show you what the problems are and can help you solving it easier. 一条建议,总是检查您的错误日志,它总是向您显示问题所在,并且可以帮助您更轻松地解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM