From 3a5079e941c76ad403ed51f7c8fa91f1f30383e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Tue, 27 May 2025 10:57:31 +0300 Subject: [PATCH 1/7] docs: add macos instruction, update blocks --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c5376f67725cd..f589ac934f56e 100644 --- a/README.md +++ b/README.md @@ -42,28 +42,55 @@ 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 +```shell +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 libtool ccache libxml2-devel sqlite-devel +```shell +sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel +``` + +On MacOS, you can install these using `brew`: + +```shell +brew install autoconf bison re2c iconv libxml2 sqlite +``` + +or with `MacPorts`: + +```shell +sudo port install autoconf bison re2c libiconv libxml2 sqlite3 +``` Generate configure: - ./buildconf +```shell +./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 +```shell +# For development +./configure --enable-debug +# For production +./configure +``` + +Build PHP. To speed up the build, specify the maximum number of jobs using `-j` argument: -Build PHP. To speed up the build, specify the maximum number of jobs using `-j`: +On Windows: +```shell +make -j4 +``` - make -j4 +On Unix system: +```shell +make -j4 +``` The number of jobs should usually match the number of available cores, which can be determined using `nproc`. @@ -76,11 +103,25 @@ 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`: - make TEST_PHP_ARGS=-j4 test +```shell +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 `TESTS` variable to test only specific directories: + +```shell +make TESTS=tests/lang/ test +``` + +Or combine the variables: + +```shell +make TEST_PHP_ARGS=-j8 TESTS=tests/lang/ test +``` + The [qa.php.net](https://qa.php.net) site provides more detailed info about testing and quality assurance. @@ -88,9 +129,11 @@ testing and quality assurance. After a successful build (and test), PHP may be installed with: - make install +```shell +make install +``` -Depending on your permissions and prefix, `make install` may need super user +Depending on your permissions and prefix, `make install` may need superuser permissions. ## PHP extensions From 892fec7c8cd5d1a046892d3aa62d2c3ed98e839f Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:10:01 +0200 Subject: [PATCH 2/7] [skip ci] Use -j4 consistently Co-authored-by: Gina Peter Banyard --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f589ac934f56e..f627cb331c126 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ make TESTS=tests/lang/ test Or combine the variables: ```shell -make TEST_PHP_ARGS=-j8 TESTS=tests/lang/ test +make TEST_PHP_ARGS=-j4 TESTS=tests/lang/ test ``` The [qa.php.net](https://qa.php.net) site provides more detailed info about From f9f67d01fb80242e0d5c7e0e4a7d20cc481cd5ce Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:11:45 +0200 Subject: [PATCH 3/7] [skip ci] Drop make instructions for windows Windows does not use make. It doesn't make sense to mention a single Windows step, as building on Windows is much more complicated. --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index f627cb331c126..e4b33511da168 100644 --- a/README.md +++ b/README.md @@ -82,12 +82,6 @@ Configure your build. `--enable-debug` is recommended for development, see Build PHP. To speed up the build, specify the maximum number of jobs using `-j` argument: -On Windows: -```shell -make -j4 -``` - -On Unix system: ```shell make -j4 ``` From 70519c4993a02f2fde447a4e90e42d682401aa5a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:14:30 +0200 Subject: [PATCH 4/7] [skip ci] Missing article --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4b33511da168..292d9e645e88a 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,8 @@ Configure your build. `--enable-debug` is recommended for development, see ./configure ``` -Build PHP. To speed up the build, specify the maximum number of jobs using `-j` argument: +Build PHP. To speed up the build, specify the maximum number of jobs using `-j` +the argument: ```shell make -j4 From 2d443a6e5c3dc3705f9b83c7ccbd5f786abcdd57 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:15:37 +0200 Subject: [PATCH 5/7] [skip ci] Oops --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 292d9e645e88a..b29c899c972f0 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,8 @@ Configure your build. `--enable-debug` is recommended for development, see ./configure ``` -Build PHP. To speed up the build, specify the maximum number of jobs using `-j` -the argument: +Build PHP. To speed up the build, specify the maximum number of jobs using the +`-j` argument: ```shell make -j4 From 43f7ec34ab2847b78d686b24b668ff156396724d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:30:49 +0200 Subject: [PATCH 6/7] [skip ci] Clarify that TESTS and TEST_PHP_ARGS are mostly equivalent --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b29c899c972f0..8d85190e683a0 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ 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`: +`TEST_PHP_ARGS` or `TESTS`: ```shell make TEST_PHP_ARGS=-j4 test @@ -105,18 +105,12 @@ 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 `TESTS` variable to test only specific directories: +Use `TEST_PHP_ARGS` or `TESTS` variable to test only specific directories: ```shell make TESTS=tests/lang/ test ``` -Or combine the variables: - -```shell -make TEST_PHP_ARGS=-j4 TESTS=tests/lang/ test -``` - The [qa.php.net](https://qa.php.net) site provides more detailed info about testing and quality assurance. From e70d08c1bf9ba072c1c9b4687d8e8c62f589fd95 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 27 Jun 2025 21:31:40 +0200 Subject: [PATCH 7/7] [skip ci] Fix missing article --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d85190e683a0..587cc9bd2dc54 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ 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 `TEST_PHP_ARGS` or `TESTS` variable to test only specific directories: +Use the `TEST_PHP_ARGS` or `TESTS` variable to test only specific directories: ```shell make TESTS=tests/lang/ test