@@ -42,28 +42,50 @@ a default build, you will additionally need libxml2 and libsqlite3.
42
42
43
43
On Ubuntu, you can install these using:
44
44
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
+ ```
47
48
48
49
On Fedora, you can install these using:
49
50
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
+ ```
51
66
52
67
Generate configure:
53
68
54
- ./buildconf
69
+ ``` shell
70
+ ./buildconf
71
+ ```
55
72
56
73
Configure your build. ` --enable-debug ` is recommended for development, see
57
74
` ./configure --help ` for a full list of options.
58
75
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
+ ```
63
82
64
- Build PHP. To speed up the build, specify the maximum number of jobs using ` -j ` :
83
+ Build PHP. To speed up the build, specify the maximum number of jobs using the
84
+ ` -j ` argument:
65
85
66
- make -j4
86
+ ``` shell
87
+ make -j4
88
+ ```
67
89
68
90
The number of jobs should usually match the number of available cores, which
69
91
can be determined using ` nproc ` .
@@ -74,23 +96,33 @@ PHP ships with an extensive test suite, the command `make test` is used after
74
96
successful compilation of the sources to run this test suite.
75
97
76
98
It is possible to run tests using multiple cores by setting ` -jN ` in
77
- ` TEST_PHP_ARGS ` :
99
+ ` TEST_PHP_ARGS ` or ` TESTS ` :
78
100
79
- make TEST_PHP_ARGS=-j4 test
101
+ ``` shell
102
+ make TEST_PHP_ARGS=-j4 test
103
+ ```
80
104
81
105
Shall run ` make test ` with a maximum of 4 concurrent jobs: Generally the maximum
82
106
number of jobs should not exceed the number of cores available.
83
107
108
+ Use the ` TEST_PHP_ARGS ` or ` TESTS ` variable to test only specific directories:
109
+
110
+ ``` shell
111
+ make TESTS=tests/lang/ test
112
+ ```
113
+
84
114
The [ qa.php.net] ( https://qa.php.net ) site provides more detailed info about
85
115
testing and quality assurance.
86
116
87
117
## Installing PHP built from source
88
118
89
119
After a successful build (and test), PHP may be installed with:
90
120
91
- make install
121
+ ``` shell
122
+ make install
123
+ ```
92
124
93
- Depending on your permissions and prefix, ` make install ` may need super user
125
+ Depending on your permissions and prefix, ` make install ` may need superuser
94
126
permissions.
95
127
96
128
## PHP extensions
0 commit comments