• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Forwarded to devs Plesk Obsidian PHP $_SERVER['SERVER_ADDR'] returns 127.0.0.1

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:
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:
Create the file `/usr/local/psa/admin/htdocs/test.php` with the following contents:

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.​
ACTUAL RESULT:
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:
In Obsidian there is a new feature: access Plesk with 443 port. This feature is optional, but you likely use it.

In this case, you open https://domain.tld/test.php which is actually one more reverse proxy to http://127.0.0.1:8880/test.php and you receive 127.0.0.1 in the server address variable.

If you need a server IP address, I would recommend finding a more reliable way for it, at least we don't use $_SERVER['SERVER_ADDR']
 
IgnorG then why does $_SERVER['SERVER_ADDR'] work fine as on Plesk Obsidian on Centos? Like I said only CloudLinux is affected. Also I'm accessing the panel using https://serverip:8443/test.php NOT https://domain.tld/test.php . (notice that I have the :8443 port in there). I'm talking about the Plesk PHP used by Plesk extensions not the PHP for websites used by the server.
 
From developer:

However, we do not modify this variable. We cannot consider it as a bug in Plesk.
As I said the variable is not reliable and not recommended for usage in extensions.
 
Back
Top