尝试在当前PHP的最新版本(5.6.10)中使用MamP3.4,但我需要PHP扩展GMP。我的理解是,这个扩展不是一个单独的模块,而是需要用-- with完整地重新编译PHP。
尝试使用干净的5.6.10源代码跟踪在这里链接的指南,但我得到的错误与OP的错误相同:
Didiers-MacBook-Pro:php-5.6.10 didier$ ./configure --with-mysql=/Applications/MAMP/Library --with-apxs2=/Applications/MAMP/Library/bin/apxs --with-gd --with-jpeg-dir=/Applications/MAMP/Library --with-png-dir=/Applications/MAMP/Library --with-zlib --with-freetype-dir=/Applications/MAMP/Library --prefix=/Applications/MAMP/bin/php5 --exec-prefix=/Applications/MAMP/bin/php5 --sysconfdir=/Applications/MAMP/conf/php5 --with-soap --with-config-file-path=/Applications/MAMP/conf/php5 --enable-track-vars --enable-bcmath --enable-ftp --enable-gd-native-ttf --with-bz2=/usr --with-ldap --with-mysqli=/Applications/MAMP/Library/bin/mysql_config --with-sqlite --with-ttf --with-t1lib=/Applications/MAMP/Library --enable-mbstring=all --with-curl=/Applications/MAMP/Library --enable-dbx --enable-sockets --enable-bcmath --with-imap=shared,/Applications/MAMP/Library/lib/imap-2006i --enable-soap --with-kerberos --enable-calendar --with-pgsql=shared,/Applications/MAMP/Library/pg --enable-dbase --enable-exif --with-libxml-dir=/Applications/MAMP/Library --with-gettext=shared,/Applications/MAMP/Library --with-xsl=/Applications/MAMP/Library --with-pdo-mysql=/Applications/MAMP/Library --with-pdo-pgsql=shared,/Applications/MAMP/Library/pg --with-mcrypt=shared,/Applications/MAMP/Library --with-openssl --with-gmp --without-iconv --prefix=/Users/Didier/Desktop/result
configure: WARNING: unrecognized options: --with-soap, --enable-track-vars, --with-sqlite, --with-ttf, --enable-dbx, --enable-dbase
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... bison -y
checking for bison version... invalid
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: 3.0).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking whether to enable computed goto gcc extension with re2c... no
checking whether cc supports -no-cpp-precomp... yes
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags...
checking for pthreads_lib...
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /Applications/MAMP/Library/bin/apxs follows:
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 217.
configure: error: Aborting发布于 2015-09-29 05:06:05
原来,您需要一些来自httpd的关键文件,以便将php构建为Apache模块(正如MAMP所要求的)。MAMP从安装中省略了这些文件。
http://mirror.reverse.net/pub/apache/httpd/下载Apache,确保您正在下载的版本与MAMP发行版中的版本相同。您可以在命令行中键入/Applications/MAMP/Library/bin/httpd -version以便找到答案。~/Desktop/build/httpd。httpd。像./configure --prefix=/Users/[username]/Desktop/build/httpd --enable-so这样的东西应该能起作用。注意,安装路径需要是绝对的,所以我们不能在这里使用倾斜字符。make和make install。现在您已经从源代码编译了一个Apache服务器。恭喜!~/Desktop/build/httpd/build的一个目录。将其复制到/Applications/MAMP/Library中,现在您将能够在没有上述错误消息的情况下构建PHP。确保您复制了目录,并且不要移动它。在PHP编译过程中,稍后您将需要它。下一步是编译PHP本身:
http://php.net/downloads.php下载PHP源代码。确保下载的版本与要替换的版本相同(您可以在/Applications/MAMP/bin/php中找到MAMP的所有版本。在我的例子中,我正在建造5.6.10号建筑。~/Desktop/build/php。./configure --with-apxs2=/Applications/MAMP/Library/bin/apxs --prefix=/Users/[username]/Desktop/build/php --with-openssl --without-iconv的东西来构建您需要的东西。如果需要,可以查看现有的phpinfo页面,了解要替换的版本,以找出它是用什么编译的。请记住,有些模块将要求您从其他库的源副本构建。make和make install.~/Dekstop/build/httpd/modules/libphp5.so复制到/Applications/MAMP/bin/php/php5.6.10/modules并重新启动它。保存上一个libphp5.so文件的副本并不是一个坏主意,以防事情恶化。https://stackoverflow.com/questions/32830551
复制相似问题