/home/install/php/include/php/ext/pdo/
[root@dm-web01 php-5.6.11]#
3.根据上面的提示操作:
# cp php.ini-production /home/install/php/lib/php.ini
# /home/install/php-5.6.11/build/shtool
install -c ext/phar/phar.phar /home/install/php/bin
# ln -s -f phar.phar
/home/install/php/bin/phar
4.#vi
/etc/php.ini (增加/home/install/php/lib/php到include_path)如下所示:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
include_path="/home/install/php/lib/php"
5.同一个目录下复制php-fpm.conf.default并改名为php-fpm.conf
# cp /home/install/php/etc/php-fpm.conf.default
/home/install/php/etc/php-fpm.conf
以下这一步是php-7版本需要操作的步骤:
#cp /home/install/php/etc/php-fpm.d/www.conf.default
/home/install/php/etc/php-fpm.d/www.conf
##################################################################
由于上面没有带gd参数所以接下来单独编译gd:
6.编译gd之前先安装 gd 前置库 : freetype ,jpegsrc,libpng:
tar jxvf freetype-2.4.0.tar.bz2
cd freetype-2.4.0
./configure --prefix=/home/install/add/freetype
# make && make install
————————————————
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9
CFLAGS="-O3 -fPIC" ./configure --prefix=/home/install/add/jpeg
make && make install
————————————————
tar zxvf libpng-1.2.50.tar.gz
cd libpng-1.2.50
CFLAGS="-O3 -fPIC" ./configure --prefix=/home/install/add/libpng
# make && make install
_________________________________________
接下来需要cd到php源码的 gd 目录,否则会报 cannot find config.m4 之类的错误。
# cd php-5.6.11
# cd ext
# cd gd
# find / -name phpize
# find / -name php-config
# /home/install/php/bin/phpize
# ./configure --with-php-config=/home/install/php/bin/php-config
-with-jpeg-dir=/home/install/add/jpeg
--with-png-dir=/home/install/add/libpng
--with-freetype-dir=/home/install/add/freetype
# make && make install
【出错:-bash: ./configure: No
such file or directory
解决:sudo
apt install autoconf
执行:autoconf】
期间出错:config.status: error: cannot find input file:
`config.h.in'
解决方案:# autoheader
安装完成后得到如下提示:
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared
extensions: /home/install/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing header
files: /home/install/php/include/php/
在
/home/install/php/lib/php/extensions/no-debug-non-zts-20131226/中生成了一个gd.so,在php.ini的[gd]添加上红色字体部分:
[gd]
; Tell the jpeg decode to ignore warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
; http://php.net/gd.jpeg-ignore-warning
;gd.jpeg_ignore_warning = 0
extension_dir=/home/install/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=gd.so
出错:# /home/install/php/sbin/php-fpm -v
[11-Oct-2016 17:33:11] NOTICE: PHP message: PHP
Warning: PHP Startup: Invalid library (maybe not
a PHP library) 'gd.so' in Unknown on line 0
解决方案:
先执行下#make clean
/home/install/php/bin/phpize
./configure --with-gd
--with-php-config=/home/install/php/bin/php-config-with-jpeg-dir=/home/install/add/jpeg
--with-png-dir=/home/install/add/libpng
--with-freetype-dir=/home/install/add/freetype
make make install
再去php.ini添加gd.so即可!