From 3720705a5b9af62e1a37a5de7b2aa34f1192da48 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 18 Jun 2014 05:36:36 -0700 Subject: [PATCH] Don't set $_SERVER['HOSTNAME'] in CLI SAPI ..to match the behavior of Zend PHP. --- hphp/runtime/base/program-functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hphp/runtime/base/program-functions.cpp b/hphp/runtime/base/program-functions.cpp index 16c94e2a21136f..2585476025c34b 100644 --- a/hphp/runtime/base/program-functions.cpp +++ b/hphp/runtime/base/program-functions.cpp @@ -596,7 +596,7 @@ void execute_command_line_begin(int argc, char **argv, int xhprof, serverArr.set(s_argc, php_global(s_argc)); serverArr.set(s_PWD, g_context->getCwd()); char hostname[1024]; - if (!gethostname(hostname, 1024)) { + if (!RuntimeOption::ClientExecutionMode() && !gethostname(hostname, 1024)) { serverArr.set(s_HOSTNAME, String(hostname, CopyString)); }