Chinaunix首页 | 论坛 | 博客
  • 博客访问: 301769
  • 博文数量: 35
  • 博客积分: 825
  • 博客等级:
  • 技术积分: 913
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-11 09:44
文章分类

全部博文(35)

文章存档

2013年(10)

2012年(24)

2010年(1)

我的朋友

分类: Python/Ruby

2013-01-07 13:56:22

昨天同事那边需要jpeg支持  原以为重新编译一下php就解决问题了 但是从phpinfo来看 gd没有支持jpeg  我们之前的安装方式都是直接把gd 之类的编译进php 没有使用extension的方式 我们用的jpeg是jpeg6a那个版本 开始的编译选项如下:

点击(此处)折叠或打开

  1. ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir=/usr/local/freetype2 --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd=/usr/local/gd2 --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-fpm --with-fpm-user=www --with-fpm-group=www --without-pear
jpeg 和 gd都是单独安装的 编译php期间还出现jpeg的共享库文件找不到的情况 要命

几次之后有点郁闷了搜了一下解决方法 有些人是在编译php时没有加入gd jpeg png等相关的选项 而是用extension的方式来支持jpeg 最后php的编译:

点击(此处)折叠或打开

  1. ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir=/usr/local/freetype2 --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt--with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-fpm --with-fpm-user=www --with-fpm-group=www --without-pear
  2. make ZEND_EXTRA_LIBS='-liconv' && make && make install
编译完之后 进入php/ext/gd 编译gd.so:

点击(此处)折叠或打开

  1. phpize
  2. make clean
  3. ./configure --with-php-config=/usr/local/php5/bin/php-config --with-jpeg-dir=/usr/local/jpeg6/ --with-freetype-dir=/usr/local/freetype2/ --with-png-dir=/usr/local/libpng/
最后在php.ini中把gd.so加上 

参考的文章:
http://chen498402552-163-com.iteye.com/blog/1161254

阅读(4778) | 评论(0) | 转发(0) |
0

上一篇:git remote

下一篇:增加删除swap临时文件

给主人留下些什么吧!~~