Linux下安装PHP

CentOS6.5下安装PHP

创新互联是网站建设技术企业,为成都企业提供专业的成都做网站、网站建设,网站设计,网站制作,网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制适合企业的网站。十年品质,值得信赖!

1、依旧是进入/usr/local/src目录下并下载PHP安装包

[root@localhost ~]# cd /usr/local/src/

[root@localhost src]# wget http://am1.php.net/distributions/php-5.3.27.tar.gz

2、解压

[root@localhost src]# tar zxf php-5.3.27.tar.gz

3、配置并编译参数

[root@localhost src]# cd php-5.3.27

在编译参数前先下载一下库文件:

[root@localhost php-5.3.27]# yum install -y libxml2-devel

[root@localhost php-5.3.27]# yum install -y openssl openssl-devel

[root@localhost php-5.3.27]# yum install -y bzip2 bzip2-devel

[root@localhost php-5.3.27]# yum install -y freetype freetype-devel

[root@localhost php-5.3.27]# yum install -y libpng libpng-devel

若还缺少哪些库文件只需按提示用yum下载即可

[root@localhost php-5.3.27]# ./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

出现下面这个则配置成功:

Linux下安装PHP

4、编译

[root@localhost php-5.3.27]#make

5、安装

[root@localhost php-5.3.27]#make install

完事!



当前标题:Linux下安装PHP
新闻来源:http://myzitong.com/article/gdeeho.html