您的位置:首页 > 运维架构 > Linux

Linux下安装PHP

2015-11-03 14:56 435 查看

检查:

whereis zlib

1.2.7-13

whereis libpng

1.5.13

whereis freetype

2.4.11

whereis jpeg

安装插件:

tar -zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure --prefix=/usr/local/zlib

make

make install

tar -zxvf libpng-1.6.17.tar.gz

cd libpng-1.6.17

-- mv ./scripts/makefile.linux ./makefile

./configure --prefix=/usr/local/png

make

make install

tar -zxvf freetype-2.5.5.tar.gz

cd freetype-2.5.5

./configure --prefix=/usr/local/freetype

make

make install

tar -zxvf jpegsrc.v9a.tar.gz

cd jpeg-9a

./configure --prefix=/usr/local/jpeg --enable-shared

make

make test

make install

tar -zxvf libgd-2.1.1.tar.gz

cd libgd-2.1.1

./configure --prefix=/usr/local/gd --with-png=/usr/local/png --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype

make

make install

tar -zxvf libgd-2.1.0.tar.gz

cd libgd-2.1.0

安装php:

tar -zxvf php-5.6.10.tar.gz

cd php-5.6.10

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=~/software/php/libxml2 --with-config-file-path=/usr/local/lib

./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs

./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png --with-jpeg --with-freetype-dir=/usr/local/freetype

./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-gd=/usr/local/gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/png --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype

./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/png --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype

./configure --prefix=/usr/local/php --enable-mbstring --disable-fileinfo --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/png --with-jpeg-dir=/usr/local/jpeg
--with-freetype-dir=/usr/local/freetype

make

make install

sudo cp php.ini-development /usr/local/php/lib/php.ini

OK!

参考:

/article/1411271.html

/article/4813850.html

添加GD库:

http://blog.chinaunix.net/uid-22914802-id-1765554.html



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: