0

我正在 SLES-12-64bit LINUX 上编译 php-5.2.8。运行配置脚本后出现以下错误。

配置:错误:未找到 png.h。

我还安装了 libpng16-devel,请参阅下面的命令输出,

# rpm -qa | grep -i libpng

libpng16-16-32bit-1.6.8-2.24.x86_64

libpng16-16-1.6.8-2.24.x86_64

libpng16-devel-32bit-1.6.8-2.2.x86_64

libpng16-devel-1.6.8-2.2.x86_64

# ls -l /usr/include/libpng16/png.h

-rw-r--r-- 1 根 149224 Sep 11 13:40 /usr/include/libpng16/png.h

以下是我提供的配置脚本的选项,./configure

    --prefix=/opt/MicroWorld/usr \
    --exec-prefix=/opt/MicroWorld/usr \
    --sysconfdir=/opt/MicroWorld/etc/httpd/php5 \
    --sharedstatedir=/opt/MicroWorld/usr/php5 \
    --libdir=/opt/MicroWorld/usr/lib/mwhttpd/php5 \
    --includedir=/opt/MicroWorld/usr/include/php5 \
    --with-apache=../apache_1.3.41 \
    --with-config-file-path=/opt/MicroWorld/etc/httpd/php5 \
    --enable-magic-quotes \
    --without-pear \
    --enable-memory-limit \
    --disable-rpath \
    --enable-sockets \
    --with-ldap \
    --enable-mbstring \
    --enable-fpm \
    --enable-shared \
    --disable-debug \
    --with-gd \
    --disable-static \
    --disable-dmalloc \
    --with-tsrm-pthreads \
    --enable-cli \
    --disable-cgi \
    --enable-inline-optimization \
    --enable-ftp \
    --enable-magic-quotes \
    --enable-calendar \
    --enable-bcmath \
    --enable-exif \
    --with-mod_charset \
    --enable-safe-mode \
    --enable-sigchild \
    --enable-dbx \
    --enable-dbase \
    --enable-gd-native-ttf \
    --disable-libxml \
    --disable-simplexml \
    --disable-xml \
    --disable-xmlreader \
    --disable-xmlwriter \
    --disable-dom \
    --enable-pthreads=static \
    --enable-pcntl \
    --enable-maintainer-zts \
    --with-gettext=/usr/local \
    --with-zlib \
    --with-libdir=lib64 \
    --with-png-dir=/usr/include/libpng16 \
    --with-jpeg-dir

非常感谢解决此问题的任何帮助。

谢谢。

4

2 回答 2

1

如果您正在运行 Debian 变体,请尝试以下操作:

sudo apt-get install build-essential

然后,您应该安装配置脚本抱怨它没有的库的“...-headers”部分(即:png.h)。要使用 CLI 找到它:

apt-cache search png | grep -i header

如果您使用的是 Redhat,我想用谷歌搜索一下可以得到等效的命令行 :)

于 2015-12-11T15:20:56.637 回答
1

Suse "12" : 搜索 libpng → →# zypper se libpng

安装开发包:# zypper in libpng12-compat-devel

或者 :# zypper in libpng14-devel


于 2015-12-12T21:27:55.080 回答