Linux下安装PHP

来源:互联网 发布:银行大数据分析现状 编辑:程序博客网 时间:2024/04/30 05:05


检查:

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!


参考:

http://blog.csdn.net/tangcheng_ok/article/details/7486922

http://www.cnblogs.com/yangxia-test/p/4174372.html

添加GD库:

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



0 0
原创粉丝点击