pzg's blog

DirectAdmin下启用EXIF for PHP

由于非常喜欢Imagevue相册的效果,所以弄了个XX版玩玩

但是安装好后提示需要exif支持,读取照片里的信息

找到DirectAdmin论坛里的帖子,安装方法如下
vi /usr/local/directadmin/custombuild/configure/ap2/configure.php5

#!/bin/sh
./configure \
        –with-apxs2 \
        –with-curl=/usr/local/lib \
        –with-gd \
        –enable-gd-native-ttf \
        –with-ttf \
        –with-gettext \
        –with-jpeg-dir=/usr/local/lib \
        –with-freetype-dir=/usr/local/lib \
        –with-kerberos \
        –with-openssl \
        –with-mcrypt \
        –with-mhash \
        –with-mysql \
        –with-mysqli \
        –with-pcre-regex=/usr/local \
        –with-pdo-mysql \
        –with-pear \
        –with-png-dir=/usr/local/lib \
        –with-zlib \
        –with-zlib-dir=/usr/local/lib \
        –enable-zip \
        –with-iconv=/usr/local \
        –enable-bcmath \
        –enable-calendar \
        –enable-ftp \
        –enable-magic-quotes \
        –enable-sockets \
        –enable-exif \
        –enable-mbstring在里面增加了–enable-exif
然后回到 /usr/local/directadmin/custombuild/下
./build php all
最后编译完成会自动重启apache
但是悲剧的是编译完成,无任何错误,进入phpinfo查看,还是没有exif

DirectAdmin的论坛里也有人发帖问这个问题,但是没有人回答

后来想到是不是因为suphp的原因
vi /usr/local/directadmin/custombuild/configure/suphp/configure.php5

#!/bin/sh
“./configure” \
“–prefix=/usr/local/php5” \
“–enable-force-cgi-redirect” \
“–enable-fastcgi” \
“–with-config-file-path=/usr/local/etc/php5/cgi” \
“–with-curl=/usr/local/lib” \
“–with-gd” \
“–with-gettext” \
“–with-jpeg-dir=/usr/local/lib” \
“–with-freetype-dir=/usr/local/lib” \
“–with-kerberos” \
“–with-openssl” \
“–with-mcrypt” \
“–with-mhash” \
“–with-mysql=/usr” \
“–with-mysqli=/usr/bin/mysql_config” \
“–with-pcre-regex=/usr/local” \
“–with-pdo-mysql=/usr” \
“–with-pear” \
“–with-png-dir=/usr/local/lib” \
“–with-zlib” \
“–with-zlib-dir=/usr/local/lib” \
“–enable-zip” \
“–enable-gd-native-ttf” \
“–with-iconv=/usr/local” \
“–enable-bcmath” \
“–enable-calendar” \
“–enable-ftp” \
“–enable-magic-quotes” \
“–enable-sockets” \
“–enable-exif” \
“–enable-mbstring”同样的在里面增加”–enable-exif” \
然后回到 /usr/local/directadmin/custombuild/下
再编译安装一次
./build php all

现在apache重启好后查看phpinfo已经有了exif,进入imagevue里查看,没有了exif不支持的警告,搞定

如果你也是使用suphp,并且要安装exif的朋友可以尝试下此方法。

《 “DirectAdmin下启用EXIF for PHP” 》 有 2 条评论

  1. Louis Han 的头像

    看照片有exif信息还是很重要的

    1. countmeon 的头像

      嗯 对于图片爱好者是很重要的

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注