Skip to content

Commit ca35527

Browse files
committed
Expand PHP build to be more featureful
1 parent 76343cc commit ca35527

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

.github/workflows/CI.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,33 @@ jobs:
157157
# Use brew bison and libiconv manually. Force linking does not work on macOS 13
158158
if [[ "$(uname)" == "Darwin" ]]; then
159159
export PATH="$(brew --prefix bison)/bin:$(brew --prefix libiconv)/bin:$PATH"
160-
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib -L$(brew --prefix libiconv)/lib"
160+
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib -L$(brew --prefix libiconv)/lib -L$(brew --prefix readline)/lib"
161161
fi
162162
163163
cd php-src
164164
./buildconf
165-
./configure --enable-shared --enable-embed=shared --enable-zts --without-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-curl --enable-mbstring
165+
166+
./configure
167+
--enable-shared --enable-embed=shared \
168+
--with-config-file-path=/usr/local/etc/php \
169+
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
170+
--enable-option-checking=fatal \
171+
--with-pic \
172+
--enable-zts \
173+
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
174+
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
175+
--with-openssl --with-password-argon2 --with-sodium=shared \
176+
--with-curl \
177+
--enable-mbstring --with-mhash \
178+
--enable-exif --enable-gd \
179+
--with-zip --with-zlib \
180+
--with-iconv \
181+
--with-readline \
182+
--disable-phpdbg \
183+
--with-pear \
184+
--enable-fileinfo \
185+
--disable-cgi
186+
166187
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
167188
sudo make install
168189
cd ..
@@ -207,7 +228,28 @@ jobs:
207228
# Build PHP
208229
cd php-src
209230
./buildconf
210-
./configure --enable-shared --enable-embed=shared --enable-zts --without-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-curl --enable-mbstring
231+
232+
./configure
233+
--enable-shared --enable-embed=shared \
234+
--with-config-file-path=/usr/local/etc/php \
235+
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
236+
--enable-option-checking=fatal \
237+
--with-pic \
238+
--enable-zts \
239+
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
240+
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
241+
--with-openssl --with-password-argon2 --with-sodium=shared \
242+
--with-curl \
243+
--enable-mbstring --with-mhash \
244+
--enable-exif --enable-gd \
245+
--with-zip --with-zlib \
246+
--with-iconv \
247+
--with-readline \
248+
--disable-phpdbg \
249+
--with-pear \
250+
--enable-fileinfo \
251+
--disable-cgi
252+
211253
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
212254
make install
213255
cd ..

INTERNALS.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ Building PHP itself is straightforward. Here's the basic configuration:
77
```sh
88
git clone https://github.com/php/php-src.git
99
cd php-src
10+
if [[ "$(uname)" == "Darwin" ]]; then
11+
export PATH="$(brew --prefix bison)/bin:$(brew --prefix libiconv)/bin:$PATH"
12+
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib -L$(brew --prefix libiconv)/lib"
13+
export ICONV=$(brew --prefix libiconv)
14+
export READLINE=$(brew --prefix readline)
15+
fi
1016
./buildconf
11-
./configure --enable-shared --enable-embed=shared --enable-zts --without-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-curl --enable-mbstring
12-
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
13-
sudo make install
14-
```
15-
16-
```sh
17-
./buildconf
18-
./configure --enable-shared --enable-embed=shared --enable-zts --with-config-file-path=/usr/local/etc/php --with-config-file-scan-dir=/usr/local/etc/php/conf.d --enable-option-checking=fatal --with-mhash --with-pic --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-iconv --with-openssl --with-readline --with-zlib --disable-phpdbg --with-pear --disable-cgi
17+
./configure --enable-shared --enable-embed=shared --enable-zts --with-config-file-path=/usr/local/etc/php --with-config-file-scan-dir=/usr/local/etc/php/conf.d --enable-option-checking=fatal --with-mhash --with-pic --enable-mbstring --enable-mysqlnd --with-mysqli --enable-exif --enable-gd --with-zip --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-iconv=$(brew --prefix libiconv) --with-openssl --with-readline=$(brew --prefix readline) --with-zlib --disable-phpdbg --with-pear --enable-fileinfo --disable-cgi
1918
make -j$([[ "$(uname)" == "Darwin" ]] && sysctl -n hw.physicalcpu || nproc)
2019
sudo make install
2120
```

0 commit comments

Comments
 (0)