php编译GD库 JPEG Support

Fatal error: Call to undefined function imagecreatefromjpeg()

http://chen498402552-163-com.iteye.com/blog/1161254

linux下,要重新安装php是不是要卸载以前的php?

1,rm -rf 你的PHP安装路径 /usr/local/php7 源码安装直接删除就行

2,重新安装php不要安装gd

cd /var/lamp/php-7.0.20

./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --with-curl --with-freetype-dir  --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip

make && make install

php源码编译常见错误解决方案

https://my.oschina.net/u/1036767/blog/312037

这个错误是因为没有安装gd 的jpeg, 虽然你用phpinfo 查看有gd但 gd 不支持 jpeg

checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.

Fix: yum install libjpeg-devel

3,执行下 make clean
/usr/local/php5/bin/phpize
./configure --with-curl --with-php-config=/usr/local/php5/bin/php-config 
make 
make install

4,找到php 源码目录
5、进入 ext/gd 目录

6,make clean
7、/usr/local/php/bin/phpize
8、./configure –with-php-config=/usr/local/php/bin/php-config –with-jpeg-dir –with-freetype-dir
9、make && make install
10、重启 httpd

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20151012/"
11.extension="gd.so"

12.service httpd restart

13.service php-fpm restart

14,查看fpm

ps aux | grep php-fpm

15,查看phpinfo(); gd库出现,

上一篇:套接字I/O模型-完成端口IOCP


下一篇:DELPHI中完成端口(IOCP)的简单分析(4)