From 4f3416d03bf10a7f39f289d1b51b4aaba810f393 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 616c4ad54fb744..7e5d1bf9beb38a 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)); }