在FreeBSD 8.3上安装php5-gd时出现错误(共享库"png.6"不存在)


Error when install php5-gd on FreeBSD 8.3(shared library "png.6" does not exist)

我更新了php到5.3。但是我不能安装gd扩展(在freebsd 8.3)
错误行:

# cd /usr/ports/graphics/php5-gd/
# make install clean
===>   php5-gd-5.3.11 depends on file: /usr/local/bin/phpize - found
===>   php5-gd-5.3.11 depends on file: /usr/local/bin/autoconf-2.69 - found
===>   php5-gd-5.3.11 depends on shared library: freetype.9 - found
===>   php5-gd-5.3.11 depends on shared library: png.6 - not found
===>    Verifying install for png.6 in /usr/ports/graphics/png
===>   Returning to build of php5-gd-5.3.11
Error: shared library "png.6" does not exist
*** Error code 1
Stop in /usr/ports/graphics/php5-gd.
*** Error code 1
Stop in /usr/ports/graphics/php5-gd.

我尝试更新和安装png lib

# cd /usr/ports/graphics/png/
# make deinstall
# cd make install clean

然后我看到:

100% tests passed, 0 tests failed out of 2
Total Test time (real) =  25.96 sec
===>  Installing for png-1.5.10
===>   Generating temporary packing list
===>  Checking if graphics/png already installed
===>   png-1.5.10 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of graphics/png
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** Error code 1
Stop in /usr/ports/graphics/png.
*** Error code 1
Stop in /usr/ports/graphics/png.
*** Error code 1
Stop in /usr/ports/graphics/php5-gd.
*** Error code 1
Stop in /usr/ports/graphics/php5-gd.

如果我开始指令FORCE_PKG_REGISTER - '"png。6"不存在"再次出现。我做了portupgrade,但它也没有帮助。有什么办法能正确避免这种错误吗?

重建ldconfig提示文件。注意:/etc/ld.so.conf和/etc/ld-elf.so.conf在FreeBSD上似乎没有任何作用。

过期提示文件错误如下所示(当正确的共享库实际存在时):

Shared object "libintl.so.8" not found, required by "vim"
所以,你必须运行这个难看的命令:
 ldconfig /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat /usr/local/lib/compat/pkg /usr/local/lib/graphviz /usr/local/lib/mysql /usr/local/lib/nss /usr/local/lib/pth /usr/local/share

也许有另一种方法来配置ld/ldconfig,使它只是工作

libpng的共享库名称是/usr/local/lib/libpng15.so.15,至少在FreeBSD 9上是这样。

由于某些原因php-gd没有接收到这个。也许它认为你使用的是Linux?

确保您的端口树是最新的。libpng的当前版本是1.5.14.