Welcome! Log In Create A New Profile

Advanced

Environment variables, php-fpm & Nginx

Posted by Pooky 
Pooky
Environment variables, php-fpm & Nginx
March 20, 2013 06:54AM
I have an ubuntu server with a handful of custom environment set in
/etc/environment as per the ubuntu community recommendation<https://help.ubuntu.com/community/EnvironmentVariables#System-wide_environment_variables>

When I use php from the command line I can use php's getenv() function to
access this variables.

Also, if I run phpinfo() from the command line I see all of my variables in
the ENVIRONMENT section.

HOWEVER:

When trying to access the same data inside processes being run by php5-fpm
this data is not available. All I can see in the ENVIRONMENT section of
phpinfo() is:

USER www-data
HOME /var/www

I know the command line uses this ini:

/etc/php5/cli/php.ini

And fpm uses:

/etc/php5/fpm/php.ini

I've not managed to find any differences between the two that would explain
why the ENV variables are not coming through in both.

Also if I run:

sudo su www-data

and then echo the environment variables I am expecting they are indeed
available to the www-data user.

What do I need to do to get my environment variables into the php processes
run by fpm?

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Re: Environment variables, php-fpm & Nginx
November 04, 2013 04:51PM
I am having the same issue. Did you manage to solve it?
Re: Environment variables, php-fpm & Nginx
December 04, 2015 07:02PM
Same here ...
Re: Environment variables, php-fpm & Nginx
December 29, 2015 07:37AM
c204129 Wrote:
-------------------------------------------------------
> I am having the same issue. [url=http://www.baloune.com/]assurance chien[/url] Did you manage to solve it?

Hello! The same for me, i don't know what to do for that.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready