@@ -42,28 +42,55 @@ a default build, you will additionally need libxml2 and libsqlite3.
4242
4343On Ubuntu, you can install these using:
4444
45- sudo apt install -y pkg-config build-essential autoconf bison re2c \
46- libxml2-dev libsqlite3-dev
45+ ``` shell
46+ sudo apt install -y pkg-config build-essential autoconf bison re2c libxml2-dev libsqlite3-dev
47+ ```
4748
4849On Fedora, you can install these using:
4950
50- sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
51+ ``` shell
52+ sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
53+ ```
54+
55+ On MacOS, you can install these using ` brew ` :
56+
57+ ``` shell
58+ brew install autoconf bison re2c iconv libxml2 sqlite
59+ ```
60+
61+ or with ` MacPorts ` :
62+
63+ ``` shell
64+ sudo port install autoconf bison re2c libiconv libxml2 sqlite3
65+ ```
5166
5267Generate configure:
5368
54- ./buildconf
69+ ``` shell
70+ ./buildconf
71+ ```
5572
5673Configure your build. ` --enable-debug ` is recommended for development, see
5774` ./configure --help ` for a full list of options.
5875
59- # For development
60- ./configure --enable-debug
61- # For production
62- ./configure
76+ ``` shell
77+ # For development
78+ ./configure --enable-debug
79+ # For production
80+ ./configure
81+ ```
82+
83+ Build PHP. To speed up the build, specify the maximum number of jobs using ` -j ` argument:
6384
64- Build PHP. To speed up the build, specify the maximum number of jobs using ` -j ` :
85+ On Windows:
86+ ``` shell
87+ make -j4
88+ ```
6589
66- make -j4
90+ On Unix system:
91+ ``` shell
92+ make -j4
93+ ```
6794
6895The number of jobs should usually match the number of available cores, which
6996can be determined using ` nproc ` .
@@ -76,21 +103,37 @@ successful compilation of the sources to run this test suite.
76103It is possible to run tests using multiple cores by setting ` -jN ` in
77104` TEST_PHP_ARGS ` :
78105
79- make TEST_PHP_ARGS=-j4 test
106+ ``` shell
107+ make TEST_PHP_ARGS=-j4 test
108+ ```
80109
81110Shall run ` make test ` with a maximum of 4 concurrent jobs: Generally the maximum
82111number of jobs should not exceed the number of cores available.
83112
113+ Use ` TESTS ` variable to test only specific directories:
114+
115+ ``` shell
116+ make TESTS=tests/lang/ test
117+ ```
118+
119+ Or combine the variables:
120+
121+ ``` shell
122+ make TEST_PHP_ARGS=-j8 TESTS=tests/lang/ test
123+ ```
124+
84125The [ qa.php.net] ( https://qa.php.net ) site provides more detailed info about
85126testing and quality assurance.
86127
87128## Installing PHP built from source
88129
89130After a successful build (and test), PHP may be installed with:
90131
91- make install
132+ ``` shell
133+ make install
134+ ```
92135
93- Depending on your permissions and prefix, ` make install ` may need super user
136+ Depending on your permissions and prefix, ` make install ` may need superuser
94137permissions.
95138
96139## PHP extensions
0 commit comments