Incorrect IP address PHP
Incorrect IP address PHP
Heya,
If I use the following code:
Then I'm seeing the IP address of my webserver. However, HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR does show the correct IP address.
I am not going to replace all my scripts with that. I just want it to give the correct IP via REMOTE_ADDR.
It's a clean installation on Ubuntu 16.04 minimal. All latests updates and PHP 7.
Does anybody knows how to fix this?
If I use the following code:
Code: Select all
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
I am not going to replace all my scripts with that. I just want it to give the correct IP via REMOTE_ADDR.
It's a clean installation on Ubuntu 16.04 minimal. All latests updates and PHP 7.
Does anybody knows how to fix this?
Re: Incorrect IP address PHP
I fixed it myself. For future references:
Run the following:
Source:
viewtopic.php?t=13817#p56361
viewtopic.php?f=10&t=13499&p=54963&hili ... .sh#p54963
Run the following:
Code: Select all
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/upd/switch_rpath.sh
chmod +x switch_rpath.sh
./switch_rpath.sh
viewtopic.php?t=13817#p56361
viewtopic.php?f=10&t=13499&p=54963&hili ... .sh#p54963