xref: /PHP-8.1/README.md (revision f47dc259)
1<div align="center">
2    <a href="https://php.net">
3        <img
4            alt="PHP"
5            src="https://www.php.net/images/logos/new-php-logo.svg"
6            width="150">
7    </a>
8</div>
9
10# The PHP Interpreter
11
12PHP is a popular general-purpose scripting language that is especially suited to
13web development. Fast, flexible and pragmatic, PHP powers everything from your
14blog to the most popular websites in the world. PHP is distributed under the
15[PHP License v3.01](LICENSE).
16
17[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/php/php-src)
18[![Build Status](https://dev.azure.com/phpazuredevops/php/_apis/build/status/php.php-src?branchName=master)](https://dev.azure.com/phpazuredevops/php/_build/latest?definitionId=1&branchName=master)
19[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:php)
20
21## Documentation
22
23The PHP manual is available at [php.net/docs](https://php.net/docs).
24
25## Installation
26
27### Prebuilt packages and binaries
28
29Prebuilt packages and binaries can be used to get up and running fast with PHP.
30
31For Windows, the PHP binaries can be obtained from
32[windows.php.net](https://windows.php.net). After extracting the archive the
33`*.exe` files are ready to use.
34
35For other systems, see the [installation chapter](https://php.net/install).
36
37### Building PHP source code
38
39*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*
40
41For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For
42a default build, you will additionally need libxml2 and libsqlite3.
43
44On Ubuntu, you can install these using:
45
46    sudo apt install -y pkg-config build-essential autoconf bison re2c \
47                        libxml2-dev libsqlite3-dev
48
49On Fedora, you can install these using:
50
51    sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
52
53Generate configure:
54
55    ./buildconf
56
57Configure your build. `--enable-debug` is recommended for development, see
58`./configure --help` for a full list of options.
59
60    # For development
61    ./configure --enable-debug
62    # For production
63    ./configure
64
65Build PHP. To speed up the build, specify the maximum number of jobs using `-j`:
66
67    make -j4
68
69The number of jobs should usually match the number of available cores, which
70can be determined using `nproc`.
71
72## Testing PHP source code
73
74PHP ships with an extensive test suite, the command `make test` is used after
75successful compilation of the sources to run this test suite.
76
77It is possible to run tests using multiple cores by setting `-jN` in
78`TEST_PHP_ARGS`:
79
80    make TEST_PHP_ARGS=-j4 test
81
82Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum
83number of jobs should not exceed the number of cores available.
84
85The [qa.php.net](https://qa.php.net) site provides more detailed info about
86testing and quality assurance.
87
88## Installing PHP built from source
89
90After a successful build (and test), PHP may be installed with:
91
92    make install
93
94Depending on your permissions and prefix, `make install` may need super user
95permissions.
96
97## PHP extensions
98
99Extensions provide additional functionality on top of PHP. PHP consists of many
100essential bundled extensions. Additional extensions can be found in the PHP
101Extension Community Library - [PECL](https://pecl.php.net).
102
103## Contributing
104
105The PHP source code is located in the Git repository at
106[github.com/php/php-src](https://github.com/php/php-src). Contributions are most
107welcome by forking the repository and sending a pull request.
108
109Discussions are done on GitHub, but depending on the topic can also be relayed
110to the official PHP developer mailing list internals@lists.php.net.
111
112New features require an RFC and must be accepted by the developers. See
113[Request for comments - RFC](https://wiki.php.net/rfc) and
114[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information
115on the process.
116
117Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in
118the commit message using `GH-NNNNNN`. Use `#NNNNNN` for tickets in the old
119[bugs.php.net](https://bugs.php.net) bug tracker.
120
121    Fix GH-7815: php_uname doesn't recognise latest Windows versions
122    Fix #55371: get_magic_quotes_gpc() throws deprecation warning
123
124See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for details on how pull
125requests are merged.
126
127### Guidelines for contributors
128
129See further documents in the repository for more information on how to
130contribute:
131
132- [Contributing to PHP](/CONTRIBUTING.md)
133- [PHP coding standards](/CODING_STANDARDS.md)
134- [Mailinglist rules](/docs/mailinglist-rules.md)
135- [PHP release process](/docs/release-process.md)
136
137## Credits
138
139For the list of people who've put work into PHP, please see the
140[PHP credits page](https://php.net/credits.php).
141