Bug 1020221

Summary: Always returns 200 for php cartridge even though php page has syntax error.
Product: OpenShift Online Reporter: Lei Zhang <lzhang>
Component: ImageAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.xCC: agoldste, bparees, dmcphers, pmorie, wzheng, xtian
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1053301 (view as bug list) Environment:
Last Closed: 2015-07-07 23:48:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 1 Lei Zhang 2013-10-17 10:21:00 UTC
Create one php app with mongodb cartridge, when accessing the php page, it will create mongo connection, if mongo db stop, it also returns 200.

content of php/mongo.php
---------------------------------------------------------
<?php
header('Content-Type: text/plain');
$m = new Mongo($_ENV['OPENSHIFT_MONGODB_DB_URL']);
#$dbname = "<database_name>";
#$db = $m->$dbname;
$db = $m->$_ENV['OPENSHIFT_APP_NAME'];

$coll = $db->factory;
$count = $coll->find()->count();

if($count == 0) {
  $insert = array("version" => "1");
  $coll->insert($insert);
}

# Accessing the page without arguments
if(empty($_GET["version"])) {
    $obj = $coll->findOne();
    $m->close();
    echo "version ".$obj["version"];
}
else {
    $coll->remove();
    $insert = array("version" => $_GET["version"]);
    $coll->insert($insert);
    $m->close();
    echo "The mongodb factory is modified\n";
}
?>
-----------------------------------------------------

Comment 2 Andy Goldstein 2013-11-04 21:13:22 UTC
I tracked this down to this: http://bugs.xdebug.org/view.php?id=587

If you install php-pecl-xdebug, PHP files with errors in them come back with a status of 200. If you uninstall that RPM, the status will come back correctly as 500.

Comment 3 Vojtech Vitek 2013-11-05 15:53:43 UTC
Thanks @Andy, so we should be able to fix this bug once we're able to complete the following Trello card: https://trello.com/c/lbjDOA6S. Then users will be able to turn off the Xdebug and thus get rid of this behaviour.

Comment 4 Vojtech Vitek 2014-01-15 00:21:26 UTC
Closing UPSTREAM:

RHEL 6 - bug 1053301
Workaround for OpenShift Origin PHP cartridge - Trello card https://trello.com/c/lbjDOA6S

Comment 5 Vojtech Vitek 2014-11-18 16:11:05 UTC
Fixed in php-pecl-xdebug-2.1.4-2 reportedly. Once the RPM is available for update, we can fix this.

Comment 6 Vojtech Vitek 2014-12-08 16:03:58 UTC
RPM is still not available. We need to wait for new RHSCL release/update.

Comment 9 Wenjing Zheng 2015-06-15 11:17:40 UTC
Verified on devenv_5549. Both php-5.3 and php-5.4 works.