[pmwiki-users] display server IPV4

Petko Yotov 5ko at 5ko.fr
Mon Aug 1 02:03:17 PDT 2022


Depending on how the server is configured, the PHP variable 
$_SERVER["SERVER_ADDR"] may contain the public IPv4 address.

On the wiki, you can display it with (:SERVER_ADDR:) if you add to 
config.php:

   Markup('SERVER_ADDR', 'inline',
     '/\\(:SERVER_ADDR:\\)/i', $_SERVER['SERVER_ADDR']);

This may not work on a shared hosting, Apache may be behind a load 
balancer or a cache, or a CDN, -- then SERVER_ADDR may be a private IP 
address, unreachable from outside.

Petko

На 01/08/2022 10:44, jdd at dodin.org написа:
> Hello,
> 
> Presently I have no xterm access to the server hosting a pmwiki
> instance, but I have write access to the wiki.
> 
> I expect it to have a variable public IPV4 (I know the IPV6 static one)
> 
> is there a way to have pmwiki display it's own public IPV4?
> 
> thanks
> jdd



More information about the pmwiki-users mailing list