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 1061849 - Enabling safe_mode in /etc/php.ini prevents php applications from being created
Summary: Enabling safe_mode in /etc/php.ini prevents php applications from being created
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: x86_64
OS: Linux
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-02-05 18:26 UTC by John Kinsella
Modified: 2017-05-31 18:22 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2017-05-31 18:22:11 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description John Kinsella 2014-02-05 18:26:41 UTC
Description of problem:
In the event that safe_mode is set to "On" in /etc/php.ini, OpenShift Origin fails while attempting to create a PHP application.

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

How reproducible:

Steps to Reproduce:
1. Edit /etc/php.ini
2. Find existing statement for safe_mode, or add new one setting it to "On"
3. Attempt to create PHP 5.3 application via console or rhc

Actual results:
Error message on failed application creation.

From /var/log/openshift/node/platform.log:
February 04 19:21:26 INFO Shell command '/sbin/runuser -s /bin/sh 52f1ae2cf73b8aad17000001 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c0,c1003' /bin/sh -c \"/var/lib/openshift/52f1ae2cf73b8aad17000001/php/bin/install --version 5.3\""' ran. rc=1 out=WARNING: running in safe mode requires that all files created be the same uid as the current script.  PHP reports this script is uid: 0, and current user is: root
Could not create "/var/lib/openshift/52f1ae2cf73b8aad17000001//.pearrc"

Error comes from line 24 in /var/lib/openshift/52f1ae2cf73b8aad17000001/php/bin/install:

  pear config-create "$OPENSHIFT_PHP_DIR"/phplib/pear/ "$OPENSHIFT_HOMEDIR"/.pearrc

Expected results:
Successfully created PHP application

Additional info:
Setting safe_mode to "Off" in /etc/php.ini allows successful PHP application creation. I'm aware that safe_mode is depreciated.

This looks like this might be a bug in pear, as when I login to a working PHP gear and inspect PHP values, I see it should be using it's own php.ini:

> php -i|grep Configuration
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /var/lib/openshift/52f1abeef73b8a212b000001/php/configuration/etc/php.ini

Comment 1 John Kinsella 2014-02-05 18:28:44 UTC
(updating product to openshift origin)

Comment 2 Eric Paris 2017-05-31 18:22:11 UTC
We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.

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