danami
Silver Pleskian
TITLE:
Plesk Obsidian PHP $_SERVER['SERVER_ADDR'] returns 127.0.0.1
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:Product version: Plesk Obsidian 18.0.20.0
OS version: CloudLinux 7.7 x86_64
Build date: 2019/10/18 18:00
Revision: e02f419139a3325041284ef4acc15b1fbbd9b2c4
PROBLEM DESCRIPTION:OS version: CloudLinux 7.7 x86_64
Build date: 2019/10/18 18:00
Revision: e02f419139a3325041284ef4acc15b1fbbd9b2c4
Plesk Obsidian 18.0.20.0 the panel PHP is returning '127.0.0.1' for the $_SERVER['SERVER_ADDR'] when the user accesses the panel using the servers IP address:
Example:
https://serverip:8443 returns 127.0.0.1
https://hostname:8443 returns the proper IP address.
STEPS TO REPRODUCE:Example:
https://serverip:8443 returns 127.0.0.1
https://hostname:8443 returns the proper IP address.
Create the file `/usr/local/psa/admin/htdocs/test.php` with the following contents:
Now access the file in the panel using https://serverip:8443/test.php and it will output '127.0.0.1' not the servers IP address.
ACTUAL RESULT:
Code:
<?php
echo $_SERVER['SERVER_ADDR'];
?>
Now access the file in the panel using https://serverip:8443/test.php and it will output '127.0.0.1' not the servers IP address.
127.0.0.1
EXPECTED RESULT:The servers IP address should be returned properly regardless of using the hostname or IP address.
ANY ADDITIONAL INFORMATION:This causes problems for plesk extension developers who rely on this on being correct.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:Confirm bug
Last edited: