Jump to content

Can't access system environment variables from PHP


cyberfinn

Recommended Posts

Hey

 

I have setup a new Debian Webserver with Apache2, PHP 5.2.9

 

I have added this line to my /etc/environment: NSL_GLOBAL_SETTINGS="/var/libraries/nsl_global_settings.ini"

 

When I type 'printenv' i got this output:

SHELL=/bin/bash

TERM=xterm

SSH_TTY=/dev/pts/0

USER=root

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

MAIL=/var/mail/root

PWD=/etc/apache2/mods-available

LANG=en_DK.UTF-8

PS1=\h:\w\$

HOME=/root

SHLVL=4

LOGNAME=root

NSL_GLOBAL_SETTINGS=/var/libraries/nsl_global_settings.ini

_=/usr/bin/printenv

 

So until everyting looks fine.

 

I ahve added this line to php.ini: variables_order = "EGPCS"

 

When i make a: var_dump($_ENV) i only got this output:

 

array(8) { ["APACHE_PID_FILE"]=> string(20) "/var/run/apache2.pid" ["APACHE_RUN_USER"]=> string(8) "www-data" ["PATH"]=> string(28) "/usr/local/bin:/usr/bin:/bin" ["PWD"]=> string(27) "/etc/apache2/mods-available" ["APACHE_RUN_GROUP"]=> string(8) "www-data" ["LANG"]=> string(1) "C" ["SHLVL"]=> string(1) "1" ["_"]=> string(17) "/usr/sbin/apache2" }

 

 

 

How do i get access to the NSL_GLOBAL_SETTINGS variables from PHP?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.