The PHP Interpreter https://www.php.net
  • C 65.9%
  • PHP 31.5%
  • C++ 0.8%
  • Shell 0.4%
  • M4 0.4%
  • Other 0.7%
Find a file
Arnaud Le Blanc ec2353c6b6
Merge branch 'PHP-8.6'
* PHP-8.6:
  [ci skip] NEWS
  Rethrow exceptions from destructors called by the GC in a fiber (#24118)
2026-10-05 18:50:33 +02:00
.circleci Merge branch 'PHP-8.5' 2026-02-27 15:05:28 +01:00
.github Merge branch 'PHP-8.5' into PHP-8.6 2026-10-02 14:16:53 +05:30
benchmark
build Fix typos, grammatical errors, and refactor misspelled local identifiers (#23803) 2026-09-24 15:56:13 +02:00
docs Fix typos, grammatical errors, and refactor misspelled local identifiers (#23803) 2026-09-24 15:56:13 +02:00
docs-old Bump libtool to serial 63 from 2.5.4 (#21067) 2026-03-11 12:37:56 -03:00
ext opcache: add opcache.enable=1 to new test 2026-10-05 14:48:27 +01:00
main Merge branch 'PHP-8.6' 2026-10-04 19:45:20 +02:00
pear
sapi Merge branch 'PHP-8.6' 2026-09-30 15:57:18 +01:00
scripts Require Autoconf 2.71 or newer (#21159) 2026-09-25 10:34:27 +02:00
tests Pin $this in zend_call_function (#22151) 2026-09-21 17:32:32 -04:00
TSRM Merge branch 'PHP-8.5' into PHP-8.6 2026-10-01 17:41:48 -04:00
win32 Zend: Remove zend_atomic.[ch] abstraction (#23927) 2026-09-29 16:30:30 +02:00
Zend Merge branch 'PHP-8.6' 2026-10-05 18:50:33 +02:00
.editorconfig
.gdbinit .gdbinit: Fix printing of variable names in print_cvs (#20077) 2025-10-06 20:17:53 +02:00
.gitattributes Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917) 2026-02-03 12:38:04 +01:00
.gitignore Run tests in parallel by default (#22939) 2026-08-10 11:33:43 +02:00
AGENTS.md [skip ci] Add AGENTS.md and CLAUDE.md files (GH-23616) 2026-09-08 20:05:26 +02:00
buildconf
buildconf.bat
CLAUDE.md [skip ci] Move CLAUDE.md to root 2026-09-16 00:19:11 +08:00
CODING_STANDARDS.md [skip ci] docs: Change example to use Throwable (#23430) 2026-08-24 09:53:07 +02:00
configure.ac Zend: Remove zend_atomic.[ch] abstraction (#23927) 2026-09-29 16:30:30 +02:00
CONTRIBUTING.md [skip ci] CONTRIBUTING: Document additional bundled libraries (#23515) 2026-09-01 00:03:25 +08:00
EXTENSIONS Merge branch 'PHP-8.5' 2026-07-03 00:19:52 +08:00
gcovr.cfg Exclude zend_gdb.c from code coverage (#23593) 2026-09-07 00:24:57 +08:00
LICENSE license-update: update Zend copyright name 2026-04-11 21:20:54 -05:00
NEWS Merge branch 'PHP-8.5' into PHP-8.6 2026-10-05 18:50:23 +02:00
php.ini-development Change pcre.backtrack_limit in the ini templates to the default value (#22868) 2026-07-24 12:21:03 +02:00
php.ini-production Change pcre.backtrack_limit in the ini templates to the default value (#22868) 2026-07-24 12:21:03 +02:00
README.md Run tests in parallel by default (#22939) 2026-08-10 11:33:43 +02:00
README.REDIST.BINS
run-extra-tests.php license-update: run-tests.php source headers 2026-04-11 21:20:54 -05:00
run-tests.php Excludes .git from run-tests.php . (#23542) 2026-09-30 13:22:20 +02:00
SECURITY.md [skip ci] Add more rejected examples in SECURITY.md (#23608) 2026-09-08 20:29:57 +02:00
UPGRADING ext/standard: Optimize pack() by avoiding redundant padding in pack() string formats (#24133) 2026-10-05 20:03:43 +08:00
UPGRADING.INTERNALS Remove unused INIT_CLASS_ENTRY_INIT_METHODS macro (#23733) 2026-10-03 14:16:28 -07:00

The PHP Interpreter

PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

PHP is distributed under the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause).

Test Fuzzing Status

Documentation

The PHP manual is available at php.net/docs.

Installation

Prebuilt packages and binaries

Prebuilt packages and binaries can be used to get up and running fast with PHP.

For Windows, the PHP binaries can be obtained from windows.php.net. After extracting the archive the *.exe files are ready to use.

For other systems, see the installation chapter.

Building PHP source code

For Windows, see Build your own PHP on Windows.

For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For a default build, you will additionally need libxml2 and libsqlite3.

On Ubuntu, you can install these using:

sudo apt install -y pkg-config build-essential autoconf bison re2c libxml2-dev libsqlite3-dev

On Fedora, you can install these using:

sudo dnf install re2c bison autoconf make ccache libxml2-devel sqlite-devel

On MacOS, you can install these using brew:

brew install autoconf bison re2c libiconv libxml2 sqlite

or with MacPorts:

sudo port install autoconf bison re2c libiconv libxml2 sqlite3

Generate configure:

./buildconf

Configure your build. --enable-debug is recommended for development, see ./configure --help for a full list of options.

# For development
./configure --enable-debug
# For production
./configure

Build PHP. To speed up the build, specify the maximum number of jobs using the -j argument:

make -j4

The number of jobs should usually match the number of available cores, which can be determined using nproc.

Testing PHP source code

PHP ships with an extensive test suite, the command make test is used after successful compilation of the sources to run this test suite.

Tests run in parallel by default, using up to 10 detected logical processors. Set -jN in TEST_PHP_ARGS or TESTS to override the worker count:

make TEST_PHP_ARGS=-j4 test

This runs make test with a maximum of 4 concurrent jobs. Alternatively, use -j1 to run tests sequentially.

Use the TEST_PHP_ARGS or TESTS variable to test only specific directories:

make TESTS=tests/lang/ test

The qa.php.net site provides more detailed info about testing and quality assurance.

Installing PHP built from source

After a successful build (and test), PHP may be installed with:

make install

Depending on your permissions and prefix, make install may need superuser permissions.

PHP extensions

Extensions provide additional functionality on top of PHP. PHP consists of many essential bundled extensions. Additional extensions can be found on the PIE Extensions list, and installed with 🥧 PIE, the PHP Installer for Extensions or the deprecated PHP Extension Community Library - PECL.

Contributing

The PHP source code is located in the Git repository at github.com/php/php-src. Contributions are most welcome by forking the repository and sending a pull request.

Discussions are done on GitHub, but depending on the topic can also be relayed to the official PHP developer mailing list internals@lists.php.net.

New features require an RFC and must be accepted by the developers. See Request for comments - RFC and Voting on PHP features for more information on the process.

Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in the commit message using GH-NNNNNN. Use #NNNNNN for tickets in the old bugs.php.net bug tracker.

Fix GH-7815: php_uname doesn't recognise latest Windows versions
Fix #55371: get_magic_quotes_gpc() throws deprecation warning

See Git workflow for details on how pull requests are merged.

Guidelines for contributors

See further documents in the repository for more information on how to contribute:

Credits

For the list of people who've put work into PHP, please see the PHP credits page.