|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Upgrade to apache 2.0 and php 4.2
Just upgraded to apache 2.0 and php 4.2.2 with red hat 8.0/i migrated my web site from my other linux box(red hat 7.3/apache 1.3.23/php 4.1.2) and the only thing that doesnt work is my ip lookup script that uses getenv().is this an apache config problem or a php.ini problem?
|
|
#2
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
Are you just doing:
$ip = getenv ("REMOTE_ADDR"); ?? What kind of error do you get? If any? |
|
#3
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
Function from my user authorization class
function upd_conn_log() { // check if the user is behind an http proxy if(getenv('HTTP_X_FORWARDED_FOR')) { $this->IP_ADDR = getenv('HTTP_X_FORWARDED_FOR'); } else if( getenv('HTTP_CLIENT_IP')) { $this->IP_ADDR = getenv('HTTP_CLIENT_IP'); } else { $this->IP_ADDR = getenv( 'REMOTE_ADDR' ); } //store info in database if(!$this->usr_name || !$this->IP_ADDR) { echo "missing info for login_track"; return; } $this->login_date=date("Y-m-d H:i:s"); echo "<BR>"; echo "$this->usr_name<br>"; echo "$this->IP_ADDR<BR>"; Here is the actual code I am using/I am not getting a value for "$this->IP_ADDR" and was getting it on my other Apache server with php 4.1.2. Just wondering what config setting needs to be altered for the genenv() variables to be enabled/documentation kind of murky or I am not looking in the right places. Thanks |
|
#4
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
Looks like this was a known bug and was fixed in a CVS version of PHP:
http://bugs.php.net/bug.php?id=17662 You might want to tryout the latest release of 4.3.0... |
|
#5
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
For a quick fix could I replace these variables with $_SERVER[] variables?
EX: replace $this->IP_ADDR = getenv( 'REMOTE_ADDR' ); with $this->IP_ADDR = $_SERVER['REMOTE_ADDR']; Any help would be appreciated. |
|
#6
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
Yep, you should be able to...
|
|
#7
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
Did you run up2date yet also?
|
|
#8
|
|||
|
|||
|
RE: Upgrade to apache 2.0 and php 4.2
up2date says i have all updates installed.
I changed the code to use $_SERVER variables and the ip logging is working again. I will pursue the upgrade end also. If you guys think of anything else to try let me know. I really appreciate all the help. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Upgrade to apache 2.0 and php 4.2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|