当我尝试使用 --with-gd 制作 php 时,出现错误“configure: error: libpng.(a|so) not found.” 怎么了?

发布于 2024-07-17 04:13:31 字数 406 浏览 3 评论 0原文

到目前为止,我已经确保我已经使用 DarwinPorts 安装了 libpng 和 libjpeg (我在 OS X Leopard 上运行),但这似乎并没有解决问题。 我在很多地方都读到,您还需要开发文件(即 libpng-devel 等)才能完成这项工作。 我有点失落。 有人可以帮助我理解我应该做什么吗? 我很高兴提供任何更多必要的信息。

我的 PHP 配置如下所示:

./configure '--with-png-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-gd'

我正在尝试安装 PHP 5.2.9。 我已经让 make 可以在没有“--with-gd”选项的情况下工作。 我也一直在复制我在各个网站上找到的内容,所以我可能做错了一些事情。

So far, I've made sure I've installed libpng and libjpeg with DarwinPorts (I'm running on OS X Leopard), but that doesn't seem to do the trick. I've read in a number of places that you need the development files (i.e. libpng-devel, etc.) as well to make this work. I'm a little lost. Can someone help me understand what I'm supposed to do? I'm happy to provide any more information that's necessary.

My configuration for PHP looks like:

./configure '--with-png-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-gd'

and I'm trying to install PHP 5.2.9. I've gotten the make to work without the '--with-gd' option. I've also been copying what I've found on various sites, so I might be doing something really wrong.

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

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

发布评论

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

评论(2

拍不死你 2024-07-24 04:13:31

此错误表明找不到 libpng.so 或 libpng.a 文件。 这些文件是在编译 libpng 时创建的。

我不太了解 Mac OS X 的安装方式,但如果您想以 Mac OS X 的方式进行安装,您可能需要找到并安装 libpng-devel 软件包。

否则,您需要获取 libpng 的源代码并自行编译。 它取决于 zlib,您可能已经拥有它的共享库,但如果没有,您也必须获得它。

这里是在 Mac OS 上编译 libpng 的指南X。 它有一个特定于达尔文的 Makefile(不知道为什么需要它,但值得一试)。

This error indicates that the libpng.so or libpng.a file could not be found. These files are created when libpng is compiled.

I don't know much about the Mac OS X way of installing things, but if you want to do it the Mac OS X way, you'll probably need to find and install that libpng-devel package.

Otherwise, you'll need to grab the source of libpng and compile it yourself. It depends on zlib, which you probably already have shared libraries for, but if not, you'll have to get that too.

Here's a guide to compiling libpng on Mac OS X. It has a darwin-specific Makefile (not sure why that's needed, but worth a try).

云之铃。 2024-07-24 04:13:31

我相信 MacPorts 默认安装到 /opt/local 而不是 /usr/local? 也许尝试 /opt/local 代替?

如果您有 fink,这是我当前正在使用的(所以我知道它有效)

这是我已安装的 fink 软件包。

 i  libpng3 1:1.2.29-1  PNG image format handling library
 i  libpng3-shlibs  1:1.2.29-1  Shared libraries for libpng3 package

 i  libjpeg 6b-17   JPEG image format handling library
 i  libjpeg-bin 6b-17   Executables for libjpeg package
 i  libjpeg-shlibs  6b-17   Shared libraries for libjpeg package

然后配置我使用的 php 的那些部分

'--with-gd' \
'--with-jpeg-dir=/sw' \
'--with-png-dir=/sw' \

I believe MacPorts installs by default to /opt/local not /usr/local? Maybe try /opt/local instead?

If you have fink, here's what I'm currently using (so i know it works)

Here are the fink packages i have installed.

 i  libpng3 1:1.2.29-1  PNG image format handling library
 i  libpng3-shlibs  1:1.2.29-1  Shared libraries for libpng3 package

 i  libjpeg 6b-17   JPEG image format handling library
 i  libjpeg-bin 6b-17   Executables for libjpeg package
 i  libjpeg-shlibs  6b-17   Shared libraries for libjpeg package

Then to configure those parts of my php I use

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