Bug 1020221 - Always returns 200 for php cartridge even though php page has syntax error.
Always returns 200 for php cartridge even though php page has syntax error.
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
2.x
Unspecified Linux
low Severity low
: ---
: ---
Assigned To: Ben Parees
libra bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-17 06:13 EDT by Lei Zhang
Modified: 2015-07-07 19:48 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1053301 (view as bug list)
Environment:
Last Closed: 2015-07-07 19:48:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 Lei Zhang 2013-10-17 06:21:00 EDT
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 16:13:22 EST
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 10:53:43 EST
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-14 19:21:26 EST
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 11:11:05 EST
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 11:03:58 EST
RPM is still not available. We need to wait for new RHSCL release/update.
Comment 9 Wenjing Zheng 2015-06-15 07:17:40 EDT
Verified on devenv_5549. Both php-5.3 and php-5.4 works.

Note You need to log in before you can comment on or make changes to this bug.