Welcome! Log In Create A New Profile

Advanced

PHP-CGI Dynamic Variable Environement unknow

Posted by Élodie BOSSIER 
Élodie BOSSIER
PHP-CGI Dynamic Variable Environement unknow
October 27, 2013 04:00PM
Greetings,

I have installed the latest version of PHP-FPM, Apache and mod_fastcgi.

All is working, except the ENV arn't GLOBAL.
I can get the IP of the visitor with $_SERVER['REMOTE_ADDR'] from a script
PHP, but i can't use this information from my mail wrapper sendmail.pl
wrote in Perl.

Before to use PHP-FPM / FastCGI, i had suphp and all were correct, even
inside my wrapper sendmail.pl in Perl.

When i check my phpinfo(), "Environment" is mostly empty, i have only USER
and HOME.

I know i can fill this part with php-fpm.conf with this :
env[MY_ENV_VAR_1] = 'value1'

and it's working, this variable is global. But how can i set REMOTE_ADDR
which is a dynamic value with the visitor ?

I have tried this :
env[REMOTE_ADDR] = $REMOTE_ADDR

but the variable $REMOTE_ADDR is empty, even if $_SERVER["REMOTE_ADDR"] is
still here, but not in GLOBAL.

I have tried this :
env[REMOTE_ADDR] = $_SERVER["REMOTE_ADDR"]

And $REMOTE_ADDR is still empty.

I have tried again this :
env[REMOTE_ADDR] = $_SERVER["REMOTE-ADDR"]

And $REMOTE_ADDR is always empty, even if $_SERVER["REMOTE_ADDR"] is still
here.

Do you have an idea please ?

--

---
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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 271
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready