我正在 Mac OS X 10.5.6 上编译 PHP5.2.9。需要一些帮助来解决这个问题。
我有 PHP 编译并使用基本配置,现在我正在尝试使用 GD2 进行编译。我遇到的问题是,如果我将参数添加到使用 Freetype 构建,则会出现构建错误。这是我演示问题的最低配置。另外,我知道对 libjpeg/libpng 等还有其他要求。我现在不包括这些要求以使其更简单。
sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/conf/php \
--enable-fastcgi \
--with-freetype-dir=/usr/local \
--with-gd
错误:
checking for FT_New_Face in -lfreetype... no
configure: error: Problem with freetype.(a|so). Please check config.log for more information.
这是来自错误日志:
configure:36779: gcc -o conftest -gstabs -no-cpp-precomp -Wl,-rpath,/usr/loca$
Undefined symbols:
"_FT_New_Face", referenced from:
_main in ccgzHTP6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 36768 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
正如我在 --with-freetype-dir 参数中定义的那样,我从源代码构建并安装在 /usr/local/ 中的 freelib-2.1.3。我认为它告诉我它正在尝试查找字体文件,但我不确定何时或是否安装了这种字体。
如果我在没有 Freetype 的情况下构建,GD2 将构建和安装,但我希望在我的系统上具有 Freetype 功能。以下是我使用 Freetype 选项的完整配置设置(失败的那个!)
sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/conf/php --enable-fastcgi \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-zlib-dir=/usr/local \
--enable-gd-native-ttf \
--with-tlib=/usr/local \
--with-freetype-dir=/usr/local \
--with-xpm-dir=/usr/X11R6 \
--with-gd