1

我正在尝试在 Mac OS X Mavericks 上自己编译 PHP。

这是配置命令:

./configure --prefix=/opt/local/php --with-config-file-path=/opt/local/php/conf 
--with-apxs2=/opt/local/apache/bin/apxs --with-mysql=/opt/local/mysql 
--with-mysql-sock=/tmp --with-libedit --with-pcre-dir=/opt/local 
--enable-bcmath --enable-mbstring --enable-sockets --enable-zip --with-bz2 
--with-curl --with-jpeg-dir=/opt/local --with-png-dir=/opt/local 
--with-freetype-dir=/opt/local --with-gd=/opt/local

当我尝试 dsudo make时,我收到此错误:

Undefined symbols for architecture x86_64:
 "_XpmLibraryVersion", referenced from:
   _zm_info_gd in gd.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

PHP 版本是 5.5.5libgd是用这个配置编译的:

./configure --prefix=/opt/local --with-png=/opt/local --with-jpeg=/opt/local 
--with-tiff=/opt/local --with-freetype=/opt/local

没有--with-gd标志,PHP 编译得很好。

这个错误是什么意思,我该如何解决?

4

2 回答 2

2

您可以通过 --with-xpm-dir=no 来配置应该禁用 xpm 支持,如果这不能解决它,请尝试安装 Mac OS X 的X11 更新。并且,您可能应该在安装该更新后重新编译libgd (到包括 libXpm)

于 2013-11-10T21:51:24.243 回答
0

这个选项在 Debian 上对我有帮助:

--with-gd=/usr/ --with-xpm-dir=/usr/ '--with-libdir=lib/x86_64-linux-gnu'
于 2017-09-19T15:33:39.443 回答