在 MacOS ElCapitan 上编译 php5 出错

在 MacOS ElCapitan 上编译 php5 出错

我正在尝试使用以下选项在 MacOS Server 5(又名 ElCapitan)上编译 php 5.6.25:

    sudo ./configure \
--prefix=/usr/local/php5 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/usr/local/php5/php.d \
--with-config-file-scan-dir=/Library/Server/Web/Config/php \
--with-apxs2=/usr/sbin/apxs \
--with-bz2=/usr  \
--with-curl=/usr \
--with-freetype-dir=/usr/local/php5 \
--with-gd \
--with-gettext \
--with-iconv-dir=/usr \
--with-imap-ssl=/usr/local \
--with-imap=/usr/local \
--with-iodbc=/usr \
--with-jpeg-dir=/usr/local/php5 \
--with-kerberos=/usr \
--with-ldap \
--with-libxml-dir=/usr \
--with-mcrypt \
--with-mhash \
--with-mysql-sock=/var/mysql \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-openssl=/usr/local/include/openssl \
--with-pcre-regex \
--with-png-dir=/usr/local/php5 \
--with-snmp=/usr \
--with-t1lib=/usr/local/php5 \
--with-tidy \
--with-xmlrpc \
--with-xsl=/usr \
--with-zlib-dir=/usr \
--with-zlib=/usr \
--without-pear \
--enable-bcmath \
--enable-calendar \
--enable-cgi \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-pcntl \
--enable-shmop  \
--enable-soap \
--enable-mbregex \
--enable-sockets \
--enable-cli \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-zip

我遇到的第一个错误是缺少 openSSL 头文件,因此我通过 homebrew 安装了它。但现在我得到:

checking "whether flock struct is linux ordered"... "no"
checking "whether flock struct is BSD ordered"... "no"
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

设置该选项后它可以编译,但我想知道,如果之前解决这个问题会不会更好。

谢谢

相关内容