Commit graph

1010 commits

Author SHA1 Message Date
Jakub Zelenka
d254078020 Merge branch 'PHP-7.4' into PHP-8.0 2020-12-13 18:42:11 +00:00
Jakub Zelenka
a221e17b41 Fix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME 2020-12-13 18:39:48 +00:00
Nikita Popov
c97da0f819 Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"
This reverts commit 98bfad738a.

This doesn't work well in some setups, see bug #80113 and GH-5051.
Reverting this for now.
2020-10-19 11:23:00 +02:00
Nikita Popov
2c15c9ce80 Rehash function table after disabling functions
To perform fast shutdown without full table cleanup we need all
internal functions to be in one continuous chunk. This was
violated when functions were deleted via disable_functions.

This drops the zend_disable_function() API in favor of
zend_disable_functions(), which disables the given list of
functions and performs the necessary rehash afterwards.

Also drop PG(disabled_functions), which is no longer used.
2020-08-28 16:50:07 +02:00
Kees Cook
2c2bb50984 sapi/fpm/config.m4: check for libapparmor's aa_change_profile()
The fpm code actually uses aa_change_profile(), not change_hat(). Test
for the correct function. (libapparmor always has both, so this is just
a correctness fix.)

Closes GH-6037.
2020-08-24 10:10:12 +02:00
Nyholm
3485ec40ce Small CS fix
The comments were incorrectly aligned. Fix this by dropping the
alignment and moving the comments before the declarations.

Closes GH-5975.
2020-08-12 12:16:53 +02:00
Jakub Zelenka
37a878b8c3 FPM: Prevent warning with raising pm.max_children for shared pool 2020-08-04 21:01:13 +01:00
Nikita Popov
4644a3ed8a XFAIL status-listen FPM test
Has frequent intermittent failures with:

ERROR: The NOTICE does not match expected message:
- PATTERN: /^\[\d\d-\w\w\w-\d{4} \d\d:\d\d:\d\d\] NOTICE: Terminating ...$/
- MESSAGE: [04-Aug-2020 08:15:37] WARNING: [pool unconfined_status] server reached max_children setting (2), consider raising it
- EXPECT: 'Terminating ...'
- ACTUAL: '2020 08:15:37] WARNING: [pool unconfined_status] server reached max_children setting (2), consider raising it'
2020-08-04 10:27:33 +02:00
Jakub Zelenka
44c7128fb7 FPM: Add pm.status_listen option
This option allows getting status from different endpoint (e.g. port
or UDS file) which is useful for getting status when all children are
busy with serving long running requests.

Internally a new shared pool with ondemand process manager is used. It
means that the status requests have reserved resources and should not
be blocked by other requests.
2020-08-03 19:14:13 +01:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
Nikita Popov
40d162e423 Merge branch 'PHP-7.4'
* PHP-7.4:
  Restore XFAIL on fpm test
2020-06-23 12:36:04 +02:00
Nikita Popov
c4639a2deb Restore XFAIL on fpm test
Still fails intermittently.
2020-06-23 12:35:11 +02:00
Michael Orlitzky
40cdc5f298 sapi/fpm/config.m4: add a new --with-fpm-apparmor configure flag.
The existing AC_FPM_APPARMOR macro (which is always run when FPM is
enabled) checks for the existence of libapparmor, and adds it to $LIBS
if found. The result is an "automagic" dependency on libapparmor that
depends not only on the user's configuration, but also on the build
host's environment.

In particular, this can cause problems if the user just happens to
have libapparmor installed (for testing or development) when he builds
PHP. Later, he may remove libapparmor, not realizing that PHP depends
on it. At that point, FPM will cease to work due to the missing library.

This commit adds a new configure flag called "--with-fpm-apparmor",
defaulting to "no", that enables or disables the feature. The new flag
is used to signal the user's intent; whether or not he wants to use
AppArmor. If he does, then we still check for the existence and
usability of libapparmor; however, it is now an error for the library
to be missing when --with-fpm-apparmor is requested.

Gentoo-bug: https://bugs.gentoo.org/637402
PHP-bug: https://bugs.php.net/bug.php?id=75519
2020-06-21 17:08:40 +01:00
Nikita Popov
ebc3043816 Merge branch 'PHP-7.4' 2020-06-18 17:02:24 +02:00
Nikita Popov
ea3a317659 Fix race condition in FPM tests
The newly de-XFAILed tests have a race condition. Make sure we
terminate only after expecting all the log lines.
2020-06-18 17:01:29 +02:00
Nikita Popov
111f05610d Merge branch 'PHP-7.4' 2020-06-18 16:00:30 +02:00
Nikita Popov
76ca6bf3ef Un-XFAIL FPM tests
These were XFAILed due to a bug in the log implementation that
caused intermittent failures. However, this issue is supposed to
be resolved in the meantime, so try dropping the XFAIL marker.
2020-06-18 15:59:32 +02:00
Christoph M. Becker
92c4b06513 Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds.  This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
2020-06-16 18:39:09 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Christoph M. Becker
864fb0ec23 Implement #47074: phpinfo() reports "On" as 1 for the some extensions
What is modified as boolean, should also be displayed as boolean.
2020-06-04 11:25:45 +02:00
George Peter Banyard
f717ec608d Adjust bogus checks in FPM as HAVE_FPM_LQ is always defined
Drop checks for FPM status as per review

Closes GH-5530
2020-05-17 22:04:35 +02:00
Máté Kocsis
68527a7834
Add stubs for some SAPIs
For apache2handler, fpm, litespeed, phpdbg, specifically.
Partially implements GH-5295
2020-05-14 13:35:12 +02:00
George Peter Banyard
f87743de9f Fix [-Wundef] warning in FPM SAPI 2020-05-12 22:02:03 +02:00
Nikita Popov
c50cfc4d3d Add quiet parameter to internal HTML entities API
In some places, we need to make sure that no warnings are thrown
due to unknown encoding. The error reporting code tried to avoid
this by determining a "safe charset", but this introduces subtle
discrepancies in which charset is picked (normally
internal_encoding takes precedence). Avoid this by suppressing
the warning in the first place.

While here, use the fallback logic to print error messages with
substitution characters more consistently, to avoid skipping
parts of the error message entirely.
2020-05-07 15:46:08 +02:00
George Peter Banyard
f91f72607b Drop unnecessary stdint and inttypes header checks
These are always available as of C99.

Closes GH-5323

Co-authored-by: "Christoph M. Becker" <cmbecker69@gmx.de>
2020-04-22 20:18:19 +02:00
Nikita Popov
ae5d7e4e96 Merge branch 'PHP-7.4'
* PHP-7.4:
  Apply doc root fix for FPM
2020-04-20 10:48:20 +02:00
Nikita Popov
721ca87e56 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Apply doc root fix for FPM
2020-04-20 10:48:05 +02:00
Nikita Popov
f62571c121 Apply doc root fix for FPM
This is the change from GH-5417 but for FPM. This was stripping the
last character from the doc_root. Given how it is used, this should
be harmless, but let's make it less confusing...
2020-04-20 10:47:54 +02:00
Nikita Popov
d68dfaf05e Remove return value from llist apply functions
Unlike the hash apply functions, these do not return int.
2020-04-15 11:01:12 +02:00
Matteo Beccati
66ec60cb45 Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip fpm tests not designed to be run as root
  Allow fpm tests to be run with long socket path
2020-04-02 16:17:24 +02:00
Matteo Beccati
87375fa2be Skip fpm tests not designed to be run as root
When running as root with TEST_FPM_RUN_AS_ROOT=1
2020-04-02 16:16:42 +02:00
Matteo Beccati
af337ae47e Allow fpm tests to be run with long socket path
Socket path is restricted to ~100 bytes, so we can use
the system temp dir if the path ends up too long.
2020-04-02 16:16:42 +02:00
Jakub Zelenka
477efe935b Merge branch 'PHP-7.4' 2020-03-29 20:21:24 +01:00
Andre Nathan
0b4e80b8c1 Allow numeric [UG]ID in FPM listen.{owner,group} 2020-03-29 20:20:01 +01:00
Nikita Popov
33ef3d64da Use separate typedef for bucket comparison function
Avoid performing the same casting dance inside each sort compare
function.
2020-03-04 12:46:06 +01:00
Nikita Popov
a297c4ef9e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix another flaky FPM test
2020-02-28 14:41:32 +01:00
Nikita Popov
b2d01e0be8 Fix another flaky FPM test 2020-02-28 14:40:21 +01:00
Nikita Popov
b89ba475df Merge branch 'PHP-7.4'
* PHP-7.4:
  Try to fix intermittent FPM failures
2020-02-28 13:19:53 +01:00
Nikita Popov
3c096b51f9 Try to fix intermittent FPM failures
Terminate only after expecting the log lines to avoid race
condition.
2020-02-28 13:19:10 +01:00
Jakub Zelenka
736b1ab200 Merge branch 'PHP-7.4' 2020-02-23 19:15:05 +00:00
Jakub Zelenka
578a8113eb Fix bug #79014 (PHP-FPM & Primary script unknown) 2020-02-23 19:14:05 +00:00
Jakub Zelenka
ee0579350f Merge branch 'PHP-7.4' 2020-02-23 18:32:20 +00:00
Jakub Zelenka
0bc6a66a7a Fix bug #77653 (operator displayed instead of the real error message) 2020-02-23 18:29:10 +00:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov
4cdd15d414 Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable parallelism for FPM tests
2020-02-03 09:58:03 +01:00
Nikita Popov
aaf9cbb7eb Disable parallelism for FPM tests
Let's see if this helps with spurious failures on Azure.
2020-02-03 09:57:34 +01:00
Nikita Popov
16f194c75e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78323: Code 0 is returned on invalid options
2020-01-27 13:32:51 +01:00
Nikita Popov
1cccbb8ff1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78323: Code 0 is returned on invalid options
2020-01-27 13:32:38 +01:00
Ivan Mikheykin
fd08f062ae Fix bug #78323: Code 0 is returned on invalid options
Set CLI exit code to 1 when invalid parameters are passed,
and print error to stderr.
2020-01-27 13:32:19 +01:00