README.md 5.0 KB
Newer Older
P
Peter Kokot 已提交
1 2 3 4
<div align="center">
    <a href="https://php.net">
        <img
            alt="PHP"
P
Peter Kokot 已提交
5
            src="https://www.php.net/images/logos/new-php-logo.svg"
P
Peter Kokot 已提交
6 7 8
            width="150">
    </a>
</div>
9

P
Peter Kokot 已提交
10
# The PHP Interpreter
11

P
Peter Kokot 已提交
12 13
PHP is a popular general-purpose scripting language that is especially suited to
web development. Fast, flexible and pragmatic, PHP powers everything from your
14 15
blog to the most popular websites in the world. PHP is distributed under the
[PHP License v3.01](LICENSE).
P
Peter Kokot 已提交
16

P
Patrick Allaert 已提交
17
[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/php/php-src)
18
[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy/branch/master?svg=true)](https://ci.appveyor.com/project/php/php-src)
J
Joe Watkins 已提交
19
[![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)
S
Stanislav Malyshev 已提交
20
[![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)
21

P
Peter Kokot 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
## Documentation

The PHP manual is available at [php.net/docs](https://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](https://windows.php.net). After extracting the archive the
`*.exe` files are ready to use.

For other systems, see the [installation chapter](https://php.net/install).

J
Joe Watkins 已提交
38
### Building PHP source code
P
Peter Kokot 已提交
39

J
Joe Watkins 已提交
40 41
*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*

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

On Ubuntu, you can install these using:
P
Peter Kokot 已提交
46

R
Rod Elias 已提交
47
    sudo apt install -y pkg-config build-essential autoconf bison re2c \
48 49
                        libxml2-dev libsqlite3-dev

50 51 52 53
On Fedora, you can install these using:

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

54
Generate configure:
J
Joe Watkins 已提交
55

56
    ./buildconf
J
Joe Watkins 已提交
57

58 59
Configure your build. `--enable-debug` is recommended for development, see
`./configure --help` for a full list of options.
J
Joe Watkins 已提交
60

61 62 63 64
    # For development
    ./configure --enable-debug
    # For production
    ./configure
J
Joe Watkins 已提交
65

66
Build PHP. To speed up the build, specify the maximum number of jobs using `-j`:
J
Joe Watkins 已提交
67 68

    make -j4
P
Peter Kokot 已提交
69

70 71
The number of jobs should usually match the number of available cores, which
can be determined using `nproc`.
J
Joe Watkins 已提交
72 73 74

## Testing PHP source code

P
Peter Kokot 已提交
75 76
PHP ships with an extensive test suite, the command `make test` is used after
successful compilation of the sources to run this test suite.
77

P
Peter Kokot 已提交
78 79
It is possible to run tests using multiple cores by setting `-jN` in
`TEST_PHP_ARGS`:
80

J
Joe Watkins 已提交
81
    make TEST_PHP_ARGS=-j4 test
P
Peter Kokot 已提交
82

P
Peter Kokot 已提交
83 84
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.
P
Peter Kokot 已提交
85

P
Peter Kokot 已提交
86 87
The [qa.php.net](https://qa.php.net) site provides more detailed info about
testing and quality assurance.
J
Joe Watkins 已提交
88 89 90 91 92 93

## Installing PHP built from source

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

    make install
P
Peter Kokot 已提交
94

P
Peter Kokot 已提交
95 96
Depending on your permissions and prefix, `make install` may need super user
permissions.
P
Peter Kokot 已提交
97 98 99 100 101 102 103 104 105

## PHP extensions

Extensions provide additional functionality on top of PHP. PHP consists of many
essential bundled extensions. Additional extensions can be found in the PHP
Extension Community Library - [PECL](https://pecl.php.net).

## Contributing

106 107
Contributions are most welcome by forking the
[GitHub repository](https://github.com/php/php-src) and sending a pull request.
P
Peter Kokot 已提交
108 109 110 111 112 113 114 115 116 117 118 119

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](https://wiki.php.net/rfc) and
[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information
on the process.

Bug fixes **do not** require an RFC but require a bug tracker ticket. Open a
ticket at [bugs.php.net](https://bugs.php.net) and reference the bug id using
`#NNNNNN`.
120 121 122

    Fix #55371: get_magic_quotes_gpc() throws deprecation warning

P
Peter Kokot 已提交
123 124 125 126
    After removing magic quotes, the get_magic_quotes_gpc function caused a
    deprecated warning. get_magic_quotes_gpc can be used to detect the
    magic_quotes behavior and therefore should not raise a warning at any time.
    The patch removes this warning.
127

128 129
See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for more details on the
pull request workflow.
H
Hannes Magnusson 已提交
130

P
Peter Kokot 已提交
131
### Guidelines for contributors
H
Hannes Magnusson 已提交
132

P
Peter Kokot 已提交
133 134 135 136
See further documents in the repository for more information on how to
contribute:

- [Contributing to PHP](/CONTRIBUTING.md)
137
- [PHP coding standards](/CODING_STANDARDS.md)
R
Rod Elias 已提交
138
- [Mailing list rules](/docs/mailinglist-rules.md)
139
- [PHP release process](/docs/release-process.md)
P
Peter Kokot 已提交
140

141 142 143 144
## Credits

For the list of people who've put work into PHP, please see the
[PHP credits page](https://php.net/credits.php).