Bug 1020221 - Always returns 200 for php cartridge even though php page has syntax error.
Summary: Always returns 200 for php cartridge even though php page has syntax error.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-17 10:13 UTC by Lei Zhang
Modified: 2015-07-07 23:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1053301 (view as bug list)
Environment:
Last Closed: 2015-07-07 23:48:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1053301 0 unspecified CLOSED PHP 5.3 with XDebug enabled always returns '200 OK' status despite PHP syntax error 2021-02-22 00:41:40 UTC

Internal Links: 1053301

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.


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