|
  
- UID
- 1
- 帖子
- 4814
- 精华
- 41
- 积分
- 555
- 阅读权限
- 200
- 来自
- 中国PHP联盟
- 在线时间
- 576 小时
- 注册时间
- 2007-12-10
- 最后登录
- 2010-7-29
|
关于php-5.2.6配置gd的问题
关于php-5.2.6配置gd的问题 -----作者:python中国(www.okpython.com)--老老仙
freetype,jpg,libpng,zlib
php配置如下:- ./configure --prefix=/usr/local/webserver/php --with-gd=/usr/local/gd --with-mysql=/usr/local/webserver/mysql --with-iconv-dir=/usr/local/webserver/lib/libiconv/ --with-freetype-dir=/usr/local/webserver/freetype/ --with-jpeg-dir=/usr/local/webserver/jpg/ --with-png-dir=/usr/local/webserver/libpng --with-zlib --with-libxml-dir=/usr/local/webserver/libxml/ --enable-xml --disable-debug --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-config-file-path=/usr/local/webserver/php/etc
复制代码 配置gd:- ./congure --prefix=/usr/local/gd --with-png=/usr/local/libpng --with-freetype --with-jpg --with-zlib
- make&&make install
复制代码 首先make就出现了一个错误:
提示找不到png.h,
搜索了下,解决办法如下:- cp /usr/local/libpng/include/* /root/soft/gd-*
复制代码 然后继续make
make install
成功安装gd
进入php源安装目录:- cd ext/gd
- /usr/local/php/bin/phpize
- ./configure --with-php-config=/usr/local/php/bin/php-config --with-gd=/usr/local/gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-zlib-dir=/usr
复制代码 make&&make install
一切正常,最后启动PHP。
晕倒,居然提示不能加载gd.so ……- PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/gd.so' - /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/gd.so: cannot restore segment prot after reloc: Permission denied in Unknown on line 0
复制代码 gd.so已经生成在/usr/local/php/lib/php/*里面了呀
最后经过多次编译调试,终于找到问题所在了,原因是我php.ini里面写了句:
extension="gd.so"
rm php.ini之后
把php源目录下的php.ini-dist复制到/usr/local/php/etc/php.ini
最后启动PHP,一切正常。 |
|