Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1057979 - Fail to connect MongoDB via DB driver for php-5.4 apps
Summary: Fail to connect MongoDB via DB driver for php-5.4 apps
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Vojtech Vitek
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-26 10:38 UTC by Zhe Wang
Modified: 2015-05-15 00:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-26 19:10:31 UTC


Attachments (Terms of Use)

Description Zhe Wang 2014-01-26 10:38:11 UTC
Description of problem:
Given a php-5.4 app with mongodb added, it fails to connect to the mongodb from website via DB driver. On the other hand, there is no such problem for php-5.3 apps.

Version-Release number of selected component (if applicable):
devenv-stage_655

How reproducible:
always

Steps to Reproduce:
1. create a php-5.4 app with mongodb added
2. write a simple script to connect to the db. For example
<-------php/mongo.php------->

<?php
header('Content-Type: text/plain');
$m = new Mongo(getenv('OPENSHIFT_MONGODB_DB_URL'));
$db = $m->selectDB(getenv('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";
}
?>
<-------------->

3. Repeat steps 1~2 for a php-5.3 app

Actual results:
When visiting $APP_URL/mongo.php, it returns error 500, but it works fine for the php-5.3 app.

Expected results:
It should be successful to connect mongodb via DB driver.

Additional info:

Comment 3 Vojtech Vitek 2014-02-12 18:21:21 UTC
https://github.com/openshift/origin-server/pull/4749

Comment 4 Zhe Wang 2014-02-13 10:00:30 UTC
Move this bug to VERIFIED.

Tested in devenv_4369 with the same code in the description, and it returned:

version 1

when visiting the page, as expected.

Thanks.


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