Skip to content

Commit

Permalink
Improve build instructions in README
Browse files Browse the repository at this point in the history
Provide enough information to get a build going without hunting
down packages.

If someone wants to add info for macos or other distros, that
would probably be nice as well.
  • Loading branch information
nikic committed Mar 18, 2020
1 parent f768a55 commit 22a2817
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,31 @@ For other systems, see the [installation chapter](https://php.net/install).

*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*

PHP uses autotools on Unix systems to configure the build:
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:

./buildconf
./configure [options]
sudo apt install -y build-essential autoconf bison re2c \
libxml2-dev libsqlite3-dev

Generate configure:

*See `./configure -h` for configuration options.*
./buildconf

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

*See `make -h` for make options.*
# For development
./configure --enable-debug
# For production
./configure

The `-j` option shall set the maximum number of jobs `make` can use for the
build:
Build PHP. To speed up the build, specify the maximum number of jobs using `-j`:

make -j4

Shall run `make` with a maximum of 4 concurrent jobs: Generally the maximum
number of jobs should not exceed the number of cores available.
The number of jobs should usually match the number of available cores, which
can be determined using `nproc`.

## Testing PHP source code

Expand Down

0 comments on commit 22a2817

Please sign in to comment.