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
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Vojtech Vitek
QA Contact: libra bugs
Depends On:
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:
Last Closed: 2014-02-26 19:10:31 UTC
Target Upstream Version:

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):

How reproducible:

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

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");

# Accessing the page without arguments
if(empty($_GET["version"])) {
    $obj = $coll->findOne();
    echo "version ".$obj["version"];
else {
    $insert = array("version" => $_GET["version"]);
    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

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.


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