codekingpro/portable-devtools
114k
1<div align="center">
2 <a href="https://www.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[](https://github.com/php/php-src/actions/workflows/push.yml)
18[](https://issues.oss-fuzz.com/issues?q=project:php)
19
20## Documentation
21
22The PHP manual is available at [php.net/docs](https://www.php.net/docs).
23
24## Installation
25
26### Prebuilt packages and binaries
27
28Prebuilt packages and binaries can be used to get up and running fast with PHP.
29
30For Windows, the PHP binaries can be obtained from
31[windows.php.net](https://windows.php.net). After extracting the archive the
32`*.exe` files are ready to use.
33
34For other systems, see the [installation chapter](https://www.php.net/install).
35
36### Building PHP source code
37
38*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*
39
40For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For
41a default build, you will additionally need libxml2 and libsqlite3.
42
43On Ubuntu, you can install these using:
44
45```shell
46sudo apt install -y pkg-config build-essential autoconf bison re2c libxml2-dev libsqlite3-dev
47```
48
49On Fedora, you can install these using:
50
51```shell
52sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
53```
54
55On MacOS, you can install these using `brew`:
56
57```shell
58brew install autoconf bison re2c libiconv libxml2 sqlite
59```
60
61or with `MacPorts`:
62
63```shell
64sudo port install autoconf bison re2c libiconv libxml2 sqlite3
65```
66
67Generate configure:
68
69```shell
70./buildconf
71```
72
73Configure your build. `--enable-debug` is recommended for development, see
74`./configure --help` for a full list of options.
75
76```shell
77# For development
78./configure --enable-debug
79# For production
80./configure
81```
82
83Build PHP. To speed up the build, specify the maximum number of jobs using the
84`-j` argument:
85
86```shell
87make -j4
88```
89
90The number of jobs should usually match the number of available cores, which
91can be determined using `nproc`.
92
93## Testing PHP source code
94
95PHP ships with an extensive test suite, the command `make test` is used after
96successful compilation of the sources to run this test suite.
97
98It is possible to run tests using multiple cores by setting `-jN` in
99`TEST_PHP_ARGS` or `TESTS`:
100
101```shell
102make TEST_PHP_ARGS=-j4 test
103```
104
105Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum
106number of jobs should not exceed the number of cores available.
107
108Use the `TEST_PHP_ARGS` or `TESTS` variable to test only specific directories:
109
110```shell
111make TESTS=tests/lang/ test
112```
113
114The [qa.php.net](https://qa.php.net) site provides more detailed info about
115testing and quality assurance.
116
117## Installing PHP built from source
118
119After a successful build (and test), PHP may be installed with:
120
121```shell
122make install
123```
124
125Depending on your permissions and prefix, `make install` may need superuser
126permissions.
127
128## PHP extensions
129
130Extensions provide additional functionality on top of PHP. PHP consists of many
131essential bundled extensions. Additional extensions can be found in the PHP
132Extension Community Library - [PECL](https://pecl.php.net).
133
134## Contributing
135
136The PHP source code is located in the Git repository at
137[github.com/php/php-src](https://github.com/php/php-src). Contributions are most
138welcome by forking the repository and sending a pull request.
139
140Discussions are done on GitHub, but depending on the topic can also be relayed
141to the official PHP developer mailing list internals@lists.php.net.
142
143New features require an RFC and must be accepted by the developers. See
144[Request for comments - RFC](https://wiki.php.net/rfc) and
145[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information
146on the process.
147
148Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in
149the commit message using `GH-NNNNNN`. Use `#NNNNNN` for tickets in the old
150[bugs.php.net](https://bugs.php.net) bug tracker.
151
152 Fix GH-7815: php_uname doesn't recognise latest Windows versions
153 Fix #55371: get_magic_quotes_gpc() throws deprecation warning
154
155See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for details on how pull
156requests are merged.
157
158### Guidelines for contributors
159
160See further documents in the repository for more information on how to
161contribute:
162
163- [Contributing to PHP](/CONTRIBUTING.md)
164- [PHP coding standards](/CODING_STANDARDS.md)
165- [Internal documentation](https://php.github.io/php-src/)
166- [Mailing list rules](/docs/mailinglist-rules.md)
167- [PHP release process](/docs/release-process.md)
168
169## Credits
170
171For the list of people who've put work into PHP, please see the
172[PHP credits page](https://www.php.net/credits.php).
173 