在 Mac Leopard 10.5.6 上使用 GD2 和 Freetype 编译 PHP 时出错

发布于 2024-07-18 18:13:35 字数 1682 浏览 10 评论 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.  */

我从源代码构建了 freelib-2.1.3 并安装在 /usr/local/ 中,正如我在 --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 

I'm compiling PHP5.2.9 on Mac OS X 10.5.6. Need some help to figure this out.

I have PHP compiling and working with a basic config, and now I'm trying to compile with GD2. The problem I'm running into is that if I add the argument to build with Freetype, I get build errors. This is my minimum config to demo the problem. Also, I know that there are other requirements for libjpeg/libpng, etc. I'm not including those right now to make this simpler.

sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/conf/php \
--enable-fastcgi \
--with-freetype-dir=/usr/local \
--with-gd 

Error:

checking for FT_New_Face in -lfreetype... no
configure: error: Problem with freetype.(a|so). Please check config.log for more information.

This is from the error log:

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

I have freelib-2.1.3 built from source and installed at /usr/local/, as I defined in the --with-freetype-dir argument. I think its telling me its trying to find a font file, but I'm not sure when or if such a font is being installed.

If I build without Freetype, GD2 will build and install but I want to have Freetype capability on my system. The following is my complete config setup with Freetype option(the one that's failing!)

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 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄暮涼年 2024-07-25 18:13:35

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

各位 Google 搜索者请注意。 故障排除的第一步是确保您使用的是满足您需求的最新版本。

Ok, did something really stupid. I've forgotten exactly where I downloaded Freetype2 from, but the 2.1.3 version is YEARS out of date. I just updated to 2.3.9 and it freaking compiles perfectly. Bleh.

Be warned, fellow Google searchers. Step one to troubleshooting is to make sure you're using the most recent release versions of your requirements.

ぺ禁宫浮华殁 2024-07-25 18:13:35

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

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

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

Installing a custom version of PHP including desired extensions can be a challenge. An alternative to compiling everything from scratch is using MacPorts which provides the right source files, dependencies and fully automates the configure, make and make install process.

In the MacPorts port collection, the latest version of PHP and pretty much all extensions and tools are present. When a new version of PHP is released, it usually finds its way into MacPorts pretty soon, allowing to upgrade your installed version very easily.

If you do LAMP / MAMP development, MacPorts also provides the latest Apache and MySQL server versions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文