0

我正在 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 
4

2 回答 2

1

好吧,做了一件非常愚蠢的事情。我忘记了我从哪里下载 Freetype2,但是 2.1.3 版本已经过时了几年。我刚刚更新到 2.3.9,它编译得非常完美。呜呜。

请注意,谷歌搜索者。故障排除的第一步是确保您使用的是最新版本的需求。

于 2009-04-22T06:09:17.160 回答
0

安装包含所需扩展的自定义 PHP 版本可能是一个挑战。从头开始编译所有内容的替代方法是使用MacPorts,它提供正确的源文件、依赖项并完全自动化配置、制作和制作安装过程。

在 MacPorts 端口集合中,提供了最新版本的 PHP 以及几乎所有的扩展和工具。当新版本的 PHP 发布时,它通常会很快进入 MacPorts,从而可以非常轻松地升级您安装的版本。

如果你做 LAMP/MAMP 开发,MacPorts 还提供最新的 Apache 和 MySQL 服务器版本。

于 2010-09-30T07:57:04.230 回答