2009-04-22 50 views
0

我在Mac OS X 10.5.6上编译PHP5.2.9。需要一些帮助来解决这个问题。在Mac上使用GD2和Freetype编译PHP的错误Leopard 10.5.6

我有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. */ 

我已经freelib-2.1.3从源代码编译并安装位于/ usr /本地/,如我在--with-freetype-dir参数中定义。我想它告诉我它试图找到一个字体文件,但我不知道何时或如果这样的字体正在安装。

如果我没有使用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 

回答

1

好了,做了一件非常愚蠢的。我已经忘记了我从哪里下载了Freetype2,但是2.1.3版本已过期。我刚刚更新到2.3.9,它完美地编译。的Bleh。

Google搜索人员被警告。解决问题的第一步是确保您使用的是最新版本的需求。

0

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

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

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