-2

My hosting environment using Server version: Apache/2.2.14 (Unix) and I am modifying ./usr/local/apache/conf/httpd.conf to set environment variable and restarting the server .

SetEnv XML-RPC-IPs 193.45.32.21

I did set it as a first entry in the file and restarted the server . But even restarting if I try to print it is still getting me black , Am I missing any thing ?

echo "My IP address ".$_SERVER['XML-RPC-IPs'];

Thanks for your help Regards Kiran

2 Answers2

0

Environment variables are available in $_ENV in PHP.

joschi
  • 21,387
  • 3
  • 47
  • 50
0

You can get a dump of the PHP environment by setting up a page with the following code and pointing your browser to it:

<?php
phpinfo();
?>

In this case, you can find your XML-RPC-IPs content in $_SERVER["XML-RPC-IPs"].

Brian Showalter
  • 1,069
  • 9
  • 13
  • Thanks a lot for your answer , I did check php info . The variable is there , but surprisingly with different name I mean the name I gave is "XML-RPC-IPs' ( In between hyphens ) But that came as "XML_RPC_IP" ( In between underscores ) . Not sure why ... –  Aug 18 '10 at 13:53
  • That's interesting indeed. I plugged your SetEnv line into my Apache config and pulled up the phpinfo page, and the content was in $_SERVER["XML-RPC-IPs"]. – Brian Showalter Aug 18 '10 at 14:28