正如您在问题中所说,您需要编译一个Semaphore
启用的 php 版本。步骤是:
- 下载
PHP
- 使用所需的 --enable-xxx 参数执行
./configure
(我使用的列表如下所述)。这并不容易,您可能还需要安装一些 brew 包(我需要安装map-uw
和libiodbc
)。
- 执行
make
- 用新编译的版本替换
MAMP
版本
./configure
我使用的参数:
./configure \
--prefix=/Applications/MAMP/bin/php/php5.4.45 \
--exec-prefix=/Applications/MAMP/bin/php/php5.4.45 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/Applications/MAMP/bin/php/php5.4.45/conf \
--enable-cli \
--with-config-file-path=/Applications/MAMP/bin/php/php5.4.45/conf \
--with-libxml-dir=/Applications/MAMP/Library \
--with-openssl=/Applications/MAMP/Library \
--with-kerberos=/usr \
--with-zlib=/Applications/MAMP/Library \
--with-zlib-dir=/Applications/MAMP/Library \
--enable-bcmath \
--with-bz2=/Applications/MAMP/Library \
--enable-calendar \
--with-curl=/Applications/MAMP/Library \
--enable-dba \
--enable-exif \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-icu-dir=/Applications/MAMP/Library \
--with-iodbc=/Applications/MAMP/Library \
--enable-mbstring=all \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--without-pear \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--enable-shmop \
--enable-soap \
--enable-pcntl \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-xmlrpc \
--with-iconv=/Applications/MAMP/Library \
--with-xsl=/Applications/MAMP/Library \
--enable-zip \
--with-kerberos \
--enable-intl \
--with-pcre-regex \
--with-freetype-dir=/Applications/MAMP/Library \
--with-jpeg-dir=/Applications/MAMP/Library \
--with-png-dir=/Applications/MAMP/Library \
--with-t1lib=/Applications/MAMP/Library \
--with-gettext=shared,/Applications/MAMP/Library \
--with-mcrypt=shared,/Applications/MAMP/Library \
--enable-opcache \
--enable-cgi \
--with-libexpat-dir=/Applications/MAMP/Library \
--with-mhash