Bug 1019008 - Can't Access Some Environment Variables From Zend
Summary: Can't Access Some Environment Variables From Zend
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1018363
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-14 23:19 UTC by Julie
Modified: 2015-05-14 23:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1018363
Environment:
Build Name: 18397, User Guide-null-1.0 Build Date: 18-09-2013 11:58:44 Topic ID: 18362-491735 [Latest]
Last Closed: 2013-10-17 13:35:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Julie 2013-10-14 23:19:44 UTC
+++ This bug was initially created as a clone of Bug #1018363 +++

When running a PHP application I am unable to access some environment variables, specifically the OPENSHIFT_POSTGRESQL_DB_* variables.

This can be shown by the following code:

var_dump($_ENV);
# or
echo phpinfo();

You can see that the OPENSHIFT_POSTGRESQL_DB_* variables are not present when running this from a web request.  These variables are however available when running php from the command line.

--- Additional comment from Kevin Cox on 2013-10-11 14:56:07 EDT ---

Sorry, forgot to specify that I am using Zend in the description.

--- Additional comment from Julie on 2013-10-14 02:14:17 EDT ---

Hi Kevin, 
    Just want to double-check if you want to file this bug just for documentation of the product? 
If only for documentation, could you specify which section of the guide you are filing this bug against and what would you like to be documented? 
Ex: Is it just a note reminding users that they can only view PHP application environment variables via command line or are there additional commands that you want documented? 

Many thanks,
Julie

--- Additional comment from Kevin Cox on 2013-10-14 11:26:10 EDT ---

Sorry, I forgot to change it away from docs.  I don't know what component it should be in.

If this is expected behavior I guess it should be in docs but it seems like these variables should be accessible.

Comment 1 Julie 2013-10-14 23:33:15 UTC
hi Abhishek,
    Thanks for taking a look at this and please advise if there will be a bug fix or any docs impact.

Many thanks,
Julie

Comment 2 Zhe Wang 2013-10-15 03:08:53 UTC
Unable to reproduce this but in the latest STG(devenv-stage_498), and here is my webpage to list all env vars:

http://zendtst1-zwstg.stg.rhcloud.com/env.php

and the Postgresql env vars are all listed by both 

var_dump($_ENV);

AND

echo phpinfo();

Comment 3 Kevin Cox 2013-10-15 03:55:18 UTC
Looks good, any idea when it will become live?

Comment 4 Xiaoli Tian 2013-10-15 06:41:01 UTC
(In reply to Kevin Cox from comment #3)
> Looks good, any idea when it will become live?

I guess you need to stop and start your app again?

Comment 5 Abhishek Gupta 2013-10-15 23:43:12 UTC
Assigning it to the runtime team to assess if this was a recent change and if there is any impact to the related documentation.

Comment 6 Kevin Cox 2013-10-16 18:08:45 UTC
I can confirm that these variables are now available to my app.

Thanks!

Comment 9 Qiushui Zhang 2013-10-17 10:24:40 UTC
Tested on devenv_3907.
After restarting the app, the expected variables are shown correctly - by both "var_dump($_ENV);" or "echo phpinfo();"

Mark the bug as verified.


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