ID: 38341 Updated by: [EMAIL PROTECTED] Reported By: manikandan dot r at greynium dot com -Status: Open +Status: Bogus Bug Type: Output Control PHP Version: 5.1.4 New Comment:
HOST variables comes from the web server, so it doesn't exist with CLI. There is also HOSTNAME environment variable, which is usually set on *nix systems. Previous Comments: ------------------------------------------------------------------------ [2006-08-05 09:15:07] manikandan dot r at greynium dot com Description: ------------ I used $_SERVER global variable to get the hostname and it is working fine, when the programs run in command line. But i was not get the value of the hostname [ $_SERVER['HOST']] when the file runs as cronjob. How to get the value of hostname? ---- Mani Reproduce code: --------------- echo $_SERVER['HOST']; Expected result: ---------------- php5.greynium.com -My development server hostname. Actual result: -------------- Empty ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38341&edit=1