简体   繁体   English

PHP页面无法在Bluemix上运行,但是在我的本地Web服务器上可以正常工作

[英]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.

相关问题 PHP:在Web服务器上显示空白页(错误500),但在本地服务器(Smarty模板引擎)上运行良好 - PHP: Serves blank page on webserver (error 500), but works fine on local (Smarty template engine) PHP脚本无法在本地计算机上运行,​​但可以在网络服务器上运行 - PHP script not working on local computer but works on the webserver PHP mail()不能与webserver上的msmtp一起使用,通过SSH可以正常工作 - PHP mail() not working with msmtp on webserver, works fine through SSH 正则表达式在在线测试人员中工作正常,但在我的页面上不起作用 - Regex Expression works fine in online testers, but not working on my page 在本地WAMP中获取原始输出相同的代码在Web服务器上工作正常 - getting raw output in local wamp same code working fine in webserver Ajax在服务器中不起作用,但在本地主机中工作正常 - Ajax is not working in server but works fine in local host 当我链接到我的Web服务器上的PHP文件时,它将不会加载,但是当我链接到本地​​WAMP服务器上的文件时,它将完美地工作 - When I link to my PHP file on my webserver, it will not load, but when I link to it on local WAMP server it works perfectly 通过htaccess将PNG解析为PHP仅适用于本地服务器,不适用于Web服务器 - Parsing PNG as PHP via htaccess works only on local server but not on webserver 不存在的文件未重定向到我的自定义404页面。 在本地服务器上工作正常 - Non existent files not getting redirected to my custom 404 page. Works fine in local server PHP Curl请求不起作用,但在POSTMAN中工作正常 - PHP Curl request not working but works fine in POSTMAN
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM