让php support jpeg

需要重新编译
‘./configure’  ‘–prefix=/usr/local/php7’ ‘–with-curl=/usr/local/curl’   ‘–with-gettext’ ‘–with-iconv-dir’ ‘–with-mysql-sock’ ‘–with-kerberos’ ‘–with-libdir=lib64’ ‘–with-libxml-dir’ ‘–with-mysqli’ ‘–with-openssl’ ‘–with-pcre-regex’ ‘–with-pdo-mysql’ ‘–with-pdo-sqlite’ ‘–with-pear’  ‘–with-xmlrpc’ ‘–with-xsl’ ‘–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’ ‘–with-fpm-user=www’ ‘–with-fpm-group=www’
再下载安装jpeg
wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz tar xzvf jpegsrc.v9b.tar.gz ./configure –prefix=/usr/local/libjpeg –enable-shared –enable-static make && make install
再去php/ext/gd编译安装
cd /usr/local/src/php-5.6.30/ext/gd #gd的源码目录 /usr/local/php/bin/phpize #生成configure命令 ./configure –with-php-config=/usr/local/php/bin/php-config –with-png-dir –with-freetype-dir –with-jpeg-dir=/usr/lib64 -with-zlib-dir –with-gd make && make install#编译gd
重启php-fpm即可

opcache编译

1
2
3
4
cd /usr/local/src/ZendOptimizerPlus-master
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

#编辑 php.ini,追加如下内容:

1
2
3
4
5
6
7
8
9
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/opcache.so
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

#重启php-fpm

1
service php-fpm restart