[英]PHP page not working on Bluemix, but works fine on my local webserver
I'm trying to run this code 我正在尝试运行此代码
include 'safe/DAL.php';
$feedback = getAllCups();
if ($feedback != "Error.") {
for ($x = 0; $x < count($feedback); $x++) {
$tmp_cup = $feedback[$x];
echo '<a href="#" class="list-group-item">';
echo '<h4 class="list-group-item-heading">';
echo $tmp_cup->getCupName() . ', ' . $tmp_cup->getYear();
echo '</h4>';
echo '<p class="list-group-item-text">Vinnare: Inte avslutad ännu</p>';
echo'</a>';
}
} else {
echo '<a href="#" class="list-group-item">';
echo'<h4 class="list-group-item-heading">Inga cuper hittades</h4>';
echo'</a>';
}
on my bluemix app (which works fine on my local webserver, when I'm debugging) 在我的bluemix应用程序上(当我调试时,在我的本地Web服务器上运行良好)
It shows nothing, and stops any other code from being shown after this code. 它什么也不显示,并且停止在该代码之后显示任何其他代码。
I've tried to enable error reporting like this 我试图启用这样的错误报告
error_reporting(E_ALL);
but this also, does not show anything. 但这也什么也没显示。
Why does it work on my local webserver, but not on bluemix? 为什么它在我的本地Web服务器上有效,但在bluemix上却无效?
Likely, the answer to your problem lies in some error being generated by Bluemix or your code. 您的问题的答案很可能在于Bluemix或您的代码生成了一些错误。 In a production system, you don't want to output stack traces and other system errors to potential clients, so Bluemix generally forces errors to be logged only to log files. 在生产系统中,您不想将堆栈跟踪和其他系统错误输出到潜在的客户端,因此Bluemix通常强制将错误仅记录到日志文件中。
From your command line, log in to Bluemix using the cf
tool, then run this command to get the most recent logs from your app: cf logs <app_name> --recent
. 在您的命令行上,使用cf
工具登录到Bluemix,然后运行此命令以从您的应用程序获取最新日志: cf logs <app_name> --recent
。
The result should show you which file and line is causing the app crash (which may in fact be something within DAL.php). 结果应显示导致应用程序崩溃的文件和行(实际上可能是DAL.php中的某物)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.