summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2016-02-10 12:58:19 +0000
committerJoe Watkins <krakjoe@php.net>2016-02-10 12:58:19 +0000
commitdaf3d0c875634547748b791fb6291e78103bf6dc (patch)
tree667c296cf01f1d81a0b0199eb2245c6abb1fed19 /sapi
parent3ac63df9bc27226c25cca5c87804896d33a7ab4f (diff)
parentaeb5319336aa447ad24968479b8aa249dd4c43a7 (diff)
downloadphp-git-daf3d0c875634547748b791fb6291e78103bf6dc.tar.gz
Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/Makefile.frag2
-rw-r--r--sapi/fpm/fpm/fpm_main.c26
-rw-r--r--sapi/litespeed/Makefile.frag2
-rw-r--r--sapi/phpdbg/config.m42
-rw-r--r--sapi/phpdbg/phpdbg.c2
5 files changed, 29 insertions, 5 deletions
diff --git a/sapi/fpm/Makefile.frag b/sapi/fpm/Makefile.frag
index e39fbcb1e8..b0b4b34658 100644
--- a/sapi/fpm/Makefile.frag
+++ b/sapi/fpm/Makefile.frag
@@ -19,6 +19,6 @@ install-fpm: $(SAPI_FPM_PATH)
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man8
@$(INSTALL_DATA) sapi/fpm/php-fpm.8 $(INSTALL_ROOT)$(mandir)/man8/php-fpm$(program_suffix).8
- @echo "Installing PHP FPM status page: $(INSTALL_ROOT)$(datadir)/fpm/"
+ @echo "Installing PHP FPM status page: $(INSTALL_ROOT)$(datadir)/fpm/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(datadir)/fpm
@$(INSTALL_DATA) sapi/fpm/status.html $(INSTALL_ROOT)$(datadir)/fpm/status.html
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index b9c7e0b632..940d6c788d 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1071,11 +1071,14 @@ static void init_request_info(void)
}
#define APACHE_PROXY_FCGI_PREFIX "proxy:fcgi://"
- /* Fix proxy URLs in SCRIPT_FILENAME generated by Apache mod_proxy_fcgi:
+#define APACHE_PROXY_BALANCER_PREFIX "proxy:balancer://"
+ /* Fix proxy URLs in SCRIPT_FILENAME generated by Apache mod_proxy_fcgi and mod_proxy_balancer:
* proxy:fcgi://localhost:9000/some-dir/info.php/test?foo=bar
+ * proxy:balancer://localhost:9000/some-dir/info.php/test?foo=bar
* should be changed to:
* /some-dir/info.php/test
* See: http://bugs.php.net/bug.php?id=54152
+ * http://bugs.php.net/bug.php?id=62172
* https://issues.apache.org/bugzilla/show_bug.cgi?id=50851
*/
if (env_script_filename &&
@@ -1099,6 +1102,27 @@ static void init_request_info(void)
}
}
+ if (env_script_filename &&
+ strncasecmp(env_script_filename, APACHE_PROXY_BALANCER_PREFIX, sizeof(APACHE_PROXY_BALANCER_PREFIX) - 1) == 0) {
+ /* advance to first character of hostname */
+ char *p = env_script_filename + (sizeof(APACHE_PROXY_BALANCER_PREFIX) - 1);
+ while (*p != '\0' && *p != '/') {
+ p++; /* move past hostname and port */
+ }
+ if (*p != '\0') {
+ /* Copy path portion in place to avoid memory leak. Note
+ * that this also affects what script_path_translated points
+ * to. */
+ memmove(env_script_filename, p, strlen(p) + 1);
+ apache_was_here = 1;
+ }
+ /* ignore query string if sent by Apache (RewriteRule) */
+ p = strchr(env_script_filename, '?');
+ if (p) {
+ *p =0;
+ }
+ }
+
if (CGIG(fix_pathinfo)) {
struct stat st;
char *real_path = NULL;
diff --git a/sapi/litespeed/Makefile.frag b/sapi/litespeed/Makefile.frag
index 767c2e5eb1..125a3b13da 100644
--- a/sapi/litespeed/Makefile.frag
+++ b/sapi/litespeed/Makefile.frag
@@ -4,6 +4,6 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
$(BUILD_LITESPEED)
install-litespeed: $(SAPI_LITESPEED_PATH)
- @echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
+ @echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp
diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4
index aa5b0efe3a..9fb4e62984 100644
--- a/sapi/phpdbg/config.m4
+++ b/sapi/phpdbg/config.m4
@@ -11,7 +11,7 @@ PHP_ARG_ENABLE(phpdbg-webhelper, for phpdbg web SAPI support,
PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
[ --enable-phpdbg-debug Build phpdbg in debug mode], no, no)
-if test "$BUILD_PHPDBG" == "" && test "$PHP_PHPDBG" != "no"; then
+if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then
AC_HEADER_TIOCGWINSZ
AC_DEFINE(HAVE_PHPDBG, 1, [ ])
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 54e9a66f5f..8acf061983 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1297,7 +1297,7 @@ int main(int argc, char **argv) /* {{{ */
zend_bool init_file_default;
char *oplog_file;
size_t oplog_file_len;
- zend_ulong flags;
+ uint64_t flags;
char *php_optarg;
int php_optind, opt, show_banner = 1;
long cleaning = -1;