phpinfo: missing variables

vod

Verified User
Joined
Oct 25, 2005
Messages
130
Hi all,

Our phpinfo page does not show the variable HTTP_X_FORWARDED_FOR . when googling around, i saw that many other phpinfo page display such variable and its value. I am actually exploring the ways to log IP of users that are behind proxy and my finding shows that i probably need to play around with REMOTE_ADDR and HTTP_X_FORWARDED_FOR.

my php was compiled using customapache script (./build all). how can i enable HTTP_X_FORWARDED_FOR?

Thank you very much
 
I used https to view it (proxyless) and it didnt show, but when I viewed the page with http it showed "HTTP_X_FORWARDED_FOR " with my ip next to it.

Its automatic and wont show if you are not using a proxy server.
 
Hi,

I do not have HTTP_X_FORWARDED_FOR regardless whether connected using https or http. When i viewed others phpinfo on the net, most of them have that variable with my IP next to it.
They have both REMOTE_ADDR and HTTP_X_FORWARDED_FOR.

Any idea?
 
yes quite simple, you are not accessing the page via a proxy server. My isp uses transperent caches and as such I always go through a proxy server. It may also be possible you are using a proxy but it is set not to reveal the true ip (anonymous) this removes the forwarded for information and so it wouldnt show and it would think you are proxyless.
 
When i viewed others phpinfo on the net, most of them have that variable with my IP next to it.

My IP is clearly there at others phpinfo page HTTPD_X_FORWARDED_FOR, while at my own phpinfo page, i cant find HTTP_X_FORWARDED_FOR.

by the way, i am using transparent proxy i believe. my phpinfo page REMOTE ADDR variables shows my real IP. At others phpinfo page, REMOTE ADDR shows my real IP too and HTTPD_X_FORWARDED_FOR shows both my real IP and my proxy
 
Last edited:
ok I understand now sorry.

can you post your configure switches used for compiling php? They are shown on the top of phpinfo and also are in /usr/local/directadmin/customapache/configure.php
 
Hi Chrys,

Thanks for helping. Below is my configure.php:

#!/bin/sh
./configure \
--with-apxs \
--with-curl \
--with-curl-dir=/usr/local/lib \
--with-gd \
--with-gd-dir=/usr/local \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-kerberos \
--with-mcrypt \
--with-mhash \
--with-mysql=/usr \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xml \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--with-zip \
--with-openssl \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-track-vars \
--enable-mbstring \
--enable-memory-limit

I always rm configure.php before compile apache and php so i believe that is the latest configure.php from DA.

again, thanks for looking into this.
 
having 2nd thoughts best give me url to your phpinfo, in pm if you wish, lets see if it shows the right info for me using a proxy.
 
Hi Chrys,

I think it is because of my htaccess file. once i removed the file, i can see http_x_forwarded_for

thanks
 
Back
Top