Linux下安装PHP
CentOS6.5下安装PHP1、依旧是进入/usr/local/src目录下并下载PHP安装包
# cd /usr/local/src/
# wget http://am1.php.net/distributions/php-5.3.27.tar.gz
2、解压
# tar zxf php-5.3.27.tar.gz
3、配置并编译参数
# cd php-5.3.27
在编译参数前先下载一下库文件:
# yum install -y libxml2-devel
# yum install -y openssl openssl-devel
# yum install -y bzip2 bzip2-devel
# yum install -y freetype freetype-devel
# yum install -y libpng libpng-devel
若还缺少哪些库文件只需按提示用yum下载即可
# ./configure \
> --prefix=/usr/local/php \
> --with-apxs2=/usr/local/apache2/bin/apxs \
> --with-config-file-path=/usr/local/php/etc\
> --with-mysql=/usr/local/mysql \
> --with-libxml-dir \
> --with-gd \
> --with-jpeg-dir \
> --with-png-dir \
> --with-freetype-dir \
> --with-iconv-dir \
> --with-zlib-dir \
> --with-bz2 \
> --with-openssl \
> --with-mcrypt \
> --enable-soap \
> --enable-gd-native-ttf \
> --enable-mbstring \
> --enable-sockets \
> --enable-exif \
> --disable-ipv6
出现下面这个则配置成功:
http://s3.运维网.com/wyfs02/M00/75/D8/wKiom1ZDRgHBx6OiAAAlH0AB3c0273.png
4、编译
#make
5、安装
#make install
完事!
页:
[1]