You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Weilin Du f2b6b7fd3c
ext/gmp: Fix GMP error messages using outdated parameter names (#22846)
2 weeks ago
.circleci Merge branch 'PHP-8.5' 5 months ago
.github IO copy API for stream copying (#20399) 2 weeks ago
TSRM perf: move AG and SCNG into native __thread storage 3 weeks ago
Zend Add trait support for internal classes (GH-20976) 2 weeks ago
benchmark Merge branch 'PHP-8.3' into PHP-8.4 12 months ago
build Add trait support for internal classes (GH-20976) 2 weeks ago
docs [skip ci] Fix typo in writing-tests.rst 2 weeks ago
docs-old Bump libtool to serial 63 from 2.5.4 (#21067) 5 months ago
ext ext/gmp: Fix GMP error messages using outdated parameter names (#22846) 2 weeks ago
main streams: remove StreamError::$param property 2 weeks ago
pear Remove non-existing INI directive detect_unicode (#18909) 1 year ago
sapi stream: remove path parameter in stream error functions (#22792) 2 weeks ago
scripts Change bless to clean up absolute paths (#22067) 4 weeks ago
tests IO copy API for stream copying (#20399) 2 weeks ago
win32 IO copy API for stream copying (#20399) 2 weeks ago
.editorconfig Improve php-src docs sphinx build, also on *nix (GH-16743) 2 years ago
.gdbinit .gdbinit: Fix printing of variable names in `print_cvs` (#20077) 10 months ago
.gitattributes Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917) 6 months ago
.gitignore Merge branch 'PHP-8.4' 12 months ago
CODING_STANDARDS.md docs: add error message wording conventions to CODING_STANDARDS (#21761) 4 months ago
CONTRIBUTING.md [skip ci] CONTRIBUTING.md: Document the discord server as a recommended place to get help (#22333) 1 month ago
EXTENSIONS Merge branch 'PHP-8.5' 4 weeks ago
LICENSE license-update: update Zend copyright name 4 months ago
NEWS ext/gmp: Fix GMP error messages using outdated parameter names (#22846) 2 weeks ago
README.REDIST.BINS Add ext/uri skeleton along with uriparser (#18658) 1 year ago
README.md Add information about PIE extensions (#22613) 3 weeks ago
SECURITY.md [skip ci] Specify unserialize() in security policy (GH-22184) 2 months ago
UPGRADING Skip __get() when __isset() materialised the property (GH-22181) 2 weeks ago
UPGRADING.INTERNALS Add trait support for internal classes (GH-20976) 2 weeks ago
buildconf Merge branch 'PHP-8.2' into PHP-8.3 2 years ago
buildconf.bat Fix #79146: cscript can fail to run on some systems 7 years ago
configure.ac IO copy API for stream copying (#20399) 2 weeks ago
gcovr.cfg [skip ci] Suppress opcache debugging tools in gcovr 4 months ago
php.ini-development Add `error_include_args` INI option to display function args in docref (#12276) 2 months ago
php.ini-production Add `error_include_args` INI option to display function args in docref (#12276) 2 months ago
run-extra-tests.php license-update: run-tests.php source headers 4 months ago
run-tests.php run-tests: Clean the file cache directory in --file-cache-prime (#22784) 2 weeks ago

README.md

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.

It is possible to run tests using multiple cores by setting -jN in TEST_PHP_ARGS or TESTS:

make TEST_PHP_ARGS=-j4 test

Shall run make test with a maximum of 4 concurrent jobs: Generally the maximum number of jobs should not exceed the number of cores available.

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.