* origin/master:
Fix bug #67106 split main fpm config
split fpm config to two parts. PR#903
fix typo
Fix undefined behaviour in strnatcmp
Fix undefined behaviour in strnatcmp
Fixed memory leak introduced by 73458e8f
update NEWS
move the test to the right place
Fixed bug #68545 NULL pointer dereference in unserialize.c
main config = global options
secondary config = pool options
makes easier to add new pools:
duplicate pool config in fpm.d dir
https://bugs.php.net/bug.php?id=67106
- add --with-fpm-acl build option which allow to manage ACL
on Unix Domain Socket
- add listen.acl_users pool option
- add listen.acl_groups pool option
Keep old behavior (chmod) if option not used or not supported.
For consistency, with fpm_unix_resolve_socket_premissions.
Compute + Use in the same source file.
To make easier future enhancement.
Also check chdir output to fix a build warning.
Using getaddrinfo is perhaps not a good idea... if we are not able
to listen on multiple addresses...
At least this message should help to diagnose problem, ex
... Found address for localhost, socket opened on ::1
... Found multiple addresses for localhost, 127.0.0.1 ignored
Unlike other settings, this has a perfectly reasonable default, calculated using
a dynamic formula. If the default was hardcoded to "2" or something, then it
would make sense to have a warning, since that could potentially be bad, but for
a dynamically calculated value based on other mandatory settings, a notice ought
to be enough.
* PHP-5.6:
NEWS
adapt test for error message introduce in fix for #68463
Fix bug #68463 listen.allowed_clients can silently result in no allowed access
* PHP-5.6:
Raise a warning when listen = hostname used and is resolved as multiple addresses
NEWS
Fixed#68458 Change pm.start_servers default warning to notice
fix test description
tests for #895
move zlog_set_level() again
Change pm.start_servers default warning to notice
Using getaddrinfo is perhaps not a good idea... if we are not able
to listen on multiple addresses...
At least this message should help to diagnose problem, ex
... Found address for localhost, socket opened on ::1
... Found multiple addresses for localhost, 127.0.0.1 ignored
Unlike other settings, this has a perfectly reasonable default, calculated using
a dynamic formula. If the default was hardcoded to "2" or something, then it
would make sense to have a warning, since that could potentially be bad, but for
a dynamically calculated value based on other mandatory settings, a notice ought
to be enough.
Unlike other settings, this has a perfectly reasonable default, calculated using
a dynamic formula. If the default was hardcoded to "2" or something, then it
would make sense to have a warning, since that could potentially be bad, but for
a dynamically calculated value based on other mandatory settings, a notice ought
to be enough.
* PHP-5.6:
Factorization and consistency - create a fpm_use_error_log() to check when file or stderr should be used - use it everywhere for consistency - add some comments
The log level will be ignored throughout log events in fpm_unix_init_main, until
the very end when zlog_set_level is finally called.
In particular, fpm_unix_conf_wp may throw notices like this:
> [08-Nov-2014 17:13:36] NOTICE: [pool www] 'user' directive is ignored when…
Which will still appear even if log_level in php-fpm.conf is set to warning+
The log level will be ignored throughout log events in fpm_unix_init_main, until
the very end when zlog_set_level is finally called.
In particular, fpm_unix_conf_wp may throw notices like this:
> [08-Nov-2014 17:13:36] NOTICE: [pool www] 'user' directive is ignored when…
Which will still appear even if log_level in php-fpm.conf is set to warning+
* PHP-5.6:
Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
Restore default behavior when no address configured:
Listen on all IPv4 addresses.
At some time we could consider to switch to all IPv6
but this will be a BC break.
The hash need to be unique per IP + Port
Previous version have (IPv4 only)
sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port));
ProxyPass is unable to provide correct PATH_INFO
as it is not aware of file path (while SetHandler is).
As we can extract PATH_INFO from PATH_TRANSLATED,
we also need to check if present in SCRIPT_NAME
and remove it.
After applying this patch.
With mod_php
_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PATH_INFO"] /foor/bar
_SERVER["PHP_SELF"] /info.php/foo/bar
_SERVER["QUERY_STRING"] q=1
With mod_proxy_fcgi + SetHandler
_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PATH_INFO"] /foo/bar
_SERVER["PHP_SELF"] /info.php/foo/bar
_SERVER["QUERY_STRING"] q=1
With mod_proxy_fcgi + ProxyPass
_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PATH_INFO"] /foo/bar
_SERVER["PHP_SELF"] /info.php/foo/bar
_SERVER["QUERY_STRING"] q=1
As far as I can discern these are leftovers of the interactive
shell implementation that was used before PHP 5.4. Now the readline
ext makes use of normal eval calls for this.
So, dropping these until there is evidence to the contrary, as they
currently wouldn't work anyway.
* master: (51 commits)
Update Git rules
Back to -dev (with EOL notice in NEWS)
new NEWS block for the next release
It's 2014 already, fix copyright year where user visible
PHP 5.3.29
Some changes were lost in the merge commit of #66091
Updated NEWS for #66091Fixed#66091
Updated NEWS for #66091
Updated NEWS for #66091Fixed#66091
updated NEWS
updated NEWS
updated NEWS
backported the fix for bug #41577
NEWS entry for e6d93a1 / d73d44c
restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
Revert "Merge branch 'pull-request/694' into PHP-5.6"
PHP 5.3.29RC1
Fix missing type checks in various functions
...
Conflicts:
ext/date/php_date.c
ext/standard/math.c
* master:
fix nmake snap when ext name is different in target dll
force atoll macro usage on windows
Enable $ replacement in exif, ldap, pdo_pgsql and tidy
See bug #67635
NEWS
NEWS
improve previous, add message during configure
Fixed bug #67635 php links to systemd libraries without using pkg-config
Improve fix for #66608
Fixed segfault with empty break
New added opcodes don't need to be resloved
Update NEWS
Update NEWS
Update NEWS
Fixed bug #66827 Session raises E_NOTICE when session name variable is array
implemented copy libs of core exts in phpize mode
fix copy the ext dll into the prefix path in phpize mode
fix default prefix in phpize mode
fix file with zero size usage in phpize mode
Conflicts:
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/session/session.c
It is too large for php-fpm to set the listen backlog to 65535.
It is realy NOT a good idea to clog the accept queue especially
when the client or nginx has a timeout for this connection.
Assume that the php-fpm qps is 5000. It will take 13s to completely
consume the 65535 backloged connections. The connection maybe already
have been closed cause of timeout of nginx or clients. So when we accept
the 65535th socket, we get a broken pipe.
Even worse, if hundreds of php-fpm processes get a closed connection
they are just wasting time and resouces to run a heavy task and finally
get error when writing to the closed connection(error: Broken Pipe).
The really max accept queue size will be backlog+1(ie, 512 here).
We take 511 which is the same as nginx and redis.
* master: (67 commits)
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
Revert "Fix Bug #67530 error_log=syslog ignored"
--enable-fpm for the travis build
fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
NEWS
NEWS
Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
adding NEWS entry for the fix for bug #65641
Updated NEWS file for recent phpdbg fixes
Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
Fixed test
Inform about back command existence in help - Fixeskrakjoe/phpdbg#100 No way to list the current stack/frames
Fix issue krakjoe/phpdbg#98 break if does not seem to work
Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
Fix readline/libedit (Thanks to @remicollet)
Replace incorrect `E` command with `ev` in watch help
Fix typo in `finish` help
...
Conflicts:
Zend/zend_ast.c
Zend/zend_highlight.c
Zend/zend_indent.c
ext/spl/spl_array.c
ext/spl/spl_observer.c
ext/standard/info.c
* PHP-5.6:
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
Revert "Fix Bug #67530 error_log=syslog ignored"
* PHP-5.5:
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
Revert "Fix Bug #67530 error_log=syslog ignored"
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.
There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
Apache 2.4.10+ will allow the following:
```
<FilesMatch \.php$>
SetHandler proxy:fcgi://localhost:9000
</FilesMatch>
```
This is much easier than using `ProxyPassMatch` (which prevents rewriting and other stuff) and rewrites (which are a bag of hurt because when combined with user-land `.htaccess` rewrites, there's always rewrite loops, prefix breakage etc (I've tried, for weeks).
It's basically the future of using Apache (via `mod_proxy_fcgi`) together with PHP-FPM. It's also available for older versions as a standalone module, very easy to install: https://gist.github.com/progandy/6ed4eeea60f6277c3e39
However, the two bits of code this commit deletes interfere with that. They both cover CGI-only mode and were copied from that SAPI into the FPM source. See e.g. https://bugs.php.net/bug.php?id=47042
The first deleted part mangled `SCRIPT_NAME` if something like
```
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php/$1 [L]
```
is used (i.e. rewriting to `PATH_INFO`. The second part drops `PATH_INFO` if there was a `REDIRECT_URL` (with CGI mode, `SCRIPT_FILENAME` in Apache is the path to the PHP binary, and `PATH_INFO` contains the name of the script to run).
Clearly, neither applies in the case of FPM, so both are safe to delete.
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
* 'fpm-apparmor-fixed' of https://github.com/notti/php-src:
Add some basic and apparmor tests to fpm
Add --force-stderr to fpm
Add apparmor change hat functionality to fpm
* 'master' of https://git.php.net/repository/php-src:
Improved performance of func_get_args() by eliminating useless copying
fix limitation of upload size == (U)INT_MAX in CGI
Link to more readmes
test commit
Update NEWS
Fixed bug #65950 Field name truncation if the field name is bigger than 32 characters
It makes no sense to use -1 for *BSD (which is the highest value there)
and still use 128 for Linux.
Lets raise it right to up the limit and let the people lower it if they
think that 3.5Mb is too much for a process.
IMO this is better than silently dropping connections.
* PHP-5.4:
Initialize these to make Coverity happy
Typo fix: managment -> management
Use minus sign instead of hyphen
Merge branch 'pull-request/499' Fix RFC 6598 IPv4 Reserved Range Checks
* PHP-5.4:
Add --with-fpm-systemd option to report health to systemd, and systemd_interval option to configure this. The service can now use Type=notify in the systemd unit file.
systemd_interval option to configure this. The service can now use
Type=notify in the systemd unit file.
Systemd status line will looks like:
Status: "Processes active: 0, idle: 5, Requests: 90, slow: 0, Traffic: 10req/sec"
Watchdog mode is also supported. In this case watchdog interval,
configured in the unit file, override the systemd_interval option.
When not used (default), no change from previous version.
To not alter current behaviour, we simply log the problem,
so, if it occurs, the message will give explanation.
This are only warning as they don't block the server,
but such fail can explain strange (not expected) behaviour later.
* PHP-5.4:
From code coverity scan - fix some memory leak - fix some resources leak (fd) - create fpm_worker_pool_free (shared use) - possible null dref (wp->user and wp->home can be null)
* PHP-5.3:
From code coverity scan - fix some memory leak - fix some resources leak (fd) - create fpm_worker_pool_free (shared use) - possible null dref (wp->user and wp->home can be null)
- fix some memory leak
- fix some resources leak (fd)
- create fpm_worker_pool_free (shared use)
- possible null dref (wp->user and wp->home can be null)
the SCRIPT_FILENAME may contains the QUERY_STRING.
Ex : RewriteRule ^(.*)\.php$ fcgi://127.0.0.1:9000/$1.php [P]
From apache debug (build with -DFCGI_DUMP_ENV_VARS)
AH01062: sending env var 'SCRIPT_FILENAME' value 'proxy:fcgi://127.0.0.1:9000/var/www/html/info.php?foo'
AH01071: Got error 'Primary script unknown\n'
Added descriptions for the new HTTP codes:
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 511 Network Authentication Required
In fpm-log, possible buffer overflow. Check for length is done at
the beginning of the loop, so is not done when overflow occurs
on the last loop (len = 1024 or 1025). (ack from fat).
This issue where found from by static code analysis tool and, so,
I can't provide any reproducer.
Possible NULL dereference when trying to delete the single item
of a list (ack from fat).
This issues where found from by static code analysis tool and,
so, I can't provide any reproducer.