1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

6672 Commits

Author SHA1 Message Date
Peter Kokot
3927630e62 Remove unused config.h inclusion in SAPIs (#21377)
Current PHP SAPIs aren't built outside of php-src and neither is
anywhere described how such configuration header is supposed to be used.
2026-03-15 12:57:20 +01:00
Calvin Buckley
13b83a46cf Bump libtool to serial 63 from 2.5.4 (#21067)
The libtool 1.5.26 is bundled with PHP since the very early days of the
Autotools build system to ease the building process and avoid additional
dependency on the system Libtool. This updates the bundled libtool to
2.5.4 version.

Fixes and implementations:

- Fixed race conditions when building PHP in parallel ("cannot create
  .libs" warnings).
- Implements request https://bugs.php.net/70374 (Update libtool.m4)
- Fixes libtool eating -flto flags.
- Fixes GH-17310 (configure producing errors on macOS)
- Fixes GH-15946 (./configure error when building with NixOS)

Changes:
- Add a script to update autotools files.
- libtool is spread across multiple files; phpize is updated to handle
  this.
- Remove outdated hacks, i.e. for `ar`.
- Remove documentation references to external libtool, as we vendor it.
- `--with-pic` is now `--enable-pic`. Error out on the old flag.
- On macOS linker now uses -undefined dynamic_lookup flag for shared
  extensions and shared embed SAPI (libphp) instead of older
  '-undefined suppress -flat_namespace' combination.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2026-03-11 12:37:56 -03:00
Jakub Zelenka
873468c8df Merge branch 'PHP-8.5'
* PHP-8.5:
  Remove XFAIL for proc-idle-timeout.phpt
2026-03-07 13:16:19 +01:00
Jakub Zelenka
ceae788b78 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Remove XFAIL for proc-idle-timeout.phpt
2026-03-07 13:15:55 +01:00
Jakub Zelenka
6d97fd660c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Remove XFAIL for proc-idle-timeout.phpt
2026-03-07 13:15:26 +01:00
Jakub Zelenka
2379e3479a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Remove XFAIL for proc-idle-timeout.phpt
2026-03-07 13:14:34 +01:00
Jakub Zelenka
be8ac28230 Merge branch 'PHP-8.5'
* PHP-8.5:
  Add back FPM_RUN_RESOURCE_HEAVY_TESTS
2026-03-07 13:13:34 +01:00
Jakub Zelenka
04023e5e72 Remove XFAIL for proc-idle-timeout.phpt 2026-03-07 13:11:37 +01:00
Jakub Zelenka
c2a1d3925b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add back FPM_RUN_RESOURCE_HEAVY_TESTS
2026-03-07 13:09:04 +01:00
Jakub Zelenka
6d97ed57d6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add back FPM_RUN_RESOURCE_HEAVY_TESTS
2026-03-07 13:07:57 +01:00
Jakub Zelenka
1683e01391 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add back FPM_RUN_RESOURCE_HEAVY_TESTS
2026-03-07 13:07:17 +01:00
Jakub Zelenka
71a01794cc Add back FPM_RUN_RESOURCE_HEAVY_TESTS 2026-03-07 13:05:32 +01:00
Ilija Tovilo
242445e22b Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Mark sapi/fpm/tests/proc-idle-timeout.phpt as XFAIL
2026-03-07 12:42:53 +01:00
Ilija Tovilo
1177670fe5 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Mark sapi/fpm/tests/proc-idle-timeout.phpt as XFAIL
2026-03-07 12:42:46 +01:00
Ilija Tovilo
e8e6f900cd Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Mark sapi/fpm/tests/proc-idle-timeout.phpt as XFAIL
2026-03-07 12:42:39 +01:00
Ilija Tovilo
37bee6ef4c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Mark sapi/fpm/tests/proc-idle-timeout.phpt as XFAIL
2026-03-07 12:42:21 +01:00
Ilija Tovilo
3902f843f7 [skip ci] Mark sapi/fpm/tests/proc-idle-timeout.phpt as XFAIL
This test fails all the time. It should be improved.
2026-03-07 12:41:52 +01:00
Alexandre Daubois
11a95749b1 Convert more zend_parse_parameters_none() to fast ZPP (#21330) 2026-03-04 14:07:46 +01:00
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Peter Kokot
f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
ndossche
bfd66bbdf0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix compile warnings under GCC 15.2.1 (#21320)
  Updated to version 2026.1 (2026a)
2026-03-02 23:13:40 +01:00
ndossche
210704258a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix compile warnings under GCC 15.2.1 (#21320)
2026-03-02 23:12:48 +01:00
Nora Dossche
583be5a8ca Fix compile warnings under GCC 15.2.1 (#21320)
The compiler now infers constness through string functions.
Adhere to that.
It also now warns about using multiplications in conditions.
2026-03-02 23:12:06 +01:00
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Ilija Tovilo
c6ad84fb9e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:04:24 +01:00
Ilija Tovilo
3a57b4ced5 Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.

Fixes GH-20762
Closes GH-20935
2026-02-27 15:00:35 +01:00
Peter Kokot
7158e6376e Merge branch 'PHP-8.5'
* PHP-8.5:
  sapi/*/Makefile.frag: install programs built with libtool, with libtool
2026-02-23 17:21:24 +01:00
Peter Kokot
c89b363fc9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  sapi/*/Makefile.frag: install programs built with libtool, with libtool
2026-02-23 17:20:59 +01:00
Michael Orlitzky
db6cca26dd sapi/*/Makefile.frag: install programs built with libtool, with libtool
When installing executables that were built using libtool, we are
supposed to use

  $ libtool --mode-install <install-command>

rather than the bare <install-command>. This is discussed ever so
briefly in the "Installing executables" section of the GNU libtool
documentation:

  https://www.gnu.org/software/libtool/manual/libtool.html

So far this has not caused a problem with GNU libtool on the platforms
that PHP supports, but there is an alternate libtool implementation
called slibtool that stores wrappers at the locations where PHP is
expecting the true executables to live. As a result, the wrappers (and
not the executables) are installed when slibtool is used to build PHP.

This is fixed by replacing,

  $(INSTALL)

with

  $(LIBTOOL) --mode=install $(INSTALL)

in the install-foo rules for the executables that are built with
libtool.

Closes GH-13674
2026-02-23 17:19:23 +01:00
Ilija Tovilo
6173a9a109 VAR|TMP overhaul (GH-20628)
The aim of this PR is twofold:

- Reduce the number of highly similar TMP|VAR handlers
- Avoid ZVAL_DEREF in most of these cases

This is achieved by guaranteeing that all zend_compile_expr() calls, as well as
all other compile calls with BP_VAR_{R,IS}, will result in a TMP variable. This
implies that the result will not contain an IS_INDIRECT or IS_REFERENCE value,
which was mostly already the case, with two exceptions:

- Calls to return-by-reference functions. Because return-by-reference functions
  are quite rare, this is solved by delegating the DEREF to the RETURN_BY_REF
  handler, which will examine the stack to check whether the caller expects a
  VAR or TMP to understand whether the DEREF is needed. Internal functions will
  also need to adjust by calling the zend_return_unwrap_ref() function.

- By-reference assignments, including both $a = &$b, as well as $a = [&$b]. When
  the result of these expressions is used in a BP_VAR_R context, the reference
  is unwrapped via a ZEND_QM_ASSIGN opcode beforehand. This is exceptionally
  rare.

Closes GH-20628
2026-01-31 19:44:56 +01:00
Khaled Alam
d03d69a88a Remove duplicate #include statements (#21085)
* Remove duplicate #include statements across the codebase.

* feat: Restore conditional/unconditional include pairs in lscriu.c
2026-01-30 16:37:13 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Ilija Tovilo
eb1d45bd42 Restore opcache_invalidate() fuzzer behavior
The zend_exception_save() and zend_exception_restore() functions were removed in
GH-20256. However, the fuzzer expects to be able to call opcache_invalidate()
even if there was an exception thrown. I'm not sure why exactly, but let's
restore the previous behavior.

Closes OSS-Fuzz #476466130
2026-01-20 15:53:08 +01:00
Ilija Tovilo
084e409694 Remove zend_exception_save() and zend_exception_restore()
These are leftovers from the pre-PHP-7.0 era. This also implicitly solves
GH-20564 by not clearing exceptions before entering the autoloader.

Closes GH-20256
Fixes GH-20564
2026-01-16 20:18:51 +01:00
Weilin Du
4f793ba1c3 [skip ci] Fix duplicate words typos (GH-20800) 2025-12-31 02:22:09 +01:00
Arnaud Le Blanc
626f3c3c7c Unify arg info representation for internal and user functions
The arg_info member of zend_function is now always a zend_arg_info*. Before,
it was a zend_internal_arg_info* on internal functions, unless the
ZEND_ACC_USER_ARG_INFO flag was set.

Closes GH-19022
2025-12-15 16:50:49 +01:00
Niels Dossche
4d28e2af9e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  sapi/fpm: remove use of variable-length arrays (#10645)
2025-12-14 23:30:54 +01:00
Max Kellermann
5850c7de7c sapi/fpm: remove use of variable-length arrays (#10645)
According to @cmb69, PHP does not require VLA support
(https://github.com/php/php-src/pull/10304#discussion_r1069343092).
VLAs are a bad idea for several reasons, so let's get rid of them.

Two of the VLAs were probably unintended; unlike C++, C doesn't have
the concept of "constant expressions", so an array with a "const"
length is technically still a VLA.  This is fixed by removing the
"const" variable, and using sizeof() instead.

(cherry picked from commit ff2a211d55)
2025-12-14 23:30:37 +01:00
Niels Dossche
c27368c939 cli: Use zend_hash_str_find_ptr_lc() in get_mime_type() 2025-12-10 11:13:39 -08:00
René Schleusner
26e0bfa341 Fixed some typos in docs and fpm pool config (GH-20587)
* Fix some typos in docs

* Fix typo in output header example of fpm pool config
2025-12-05 20:20:40 +01:00
David Carlier
509cb06dc2 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:26:10 +00:00
David Carlier
5562e5558a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:26:01 +00:00
David Carlier
30fbcf9d7e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:25:51 +00:00
David Carlier
9149c35514 Fix GH-20554: php_cli_server() get http status as string build issue.
due to the signature of this helper it needs to be const also
bsearch key argument needs to be too.

close GH-20556
2025-11-22 22:25:33 +00:00
Gina Peter Banyard
0c97fe082f Merge branch 'PHP-8.5'
* PHP-8.5:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:34:03 +00:00
Gina Peter Banyard
e1c8ed614e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:32:14 +00:00
Gina Peter Banyard
a7fd6fc8d6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:31:42 +00:00
Gina Peter Banyard
37e61a0dc0 sapi/phpdbg: fixed ZPP type violation by using 'h' ZPP specifier instead of 'H'
This aligns the behaviour with what the stubs say.
And even if one fixes the stubs the behaviour is not identical due to missing indirect handling.

This indicates that using objects is never done, so do the easy fix of changing the ZPP specifier.

Closes GH-20465
2025-11-13 01:30:49 +00:00