apache安装php

2/13/2017来源:经验技巧人气:2168

1.install php 5.3.27所需要的库 yum install zlib-devel libxm12-devel libjpeg-devel libiconv-devel -y 检查安装的包 rpm -qa zlib-devel libxm12-devel libjpeg-devel libiconv-devel zlib-devel-1.2.3-29.el6.x86_64 yum  install freetype-devel libpng-devel gd-devel curl-devel libxslt-devel -y 检查安装的包: rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel gd-devel-2.0.35-11.el6.x86_64 freetype-devel-2.3.11-17.el6.x86_64 libpng-devel-1.2.49-2.el6_7.x86_64 libxslt-devel-1.1.26-2.el6_3.1.x86_64  yum install libmcrypt-devel mhash mhash-devel mcrypt -y 检查安装的包:  rpm -qa libmcrypt-devel mhash mhash-devel mcrypt  mcrypt-2.6.8-10.el6.x86_64 libmcrypt-devel-2.5.8-9.el6.x86_64 mhash-0.9.9.9-3.el6.x86_64 mhash-devel-0.9.9.9-3.el6.x86_64

其他的库没有进行安装的使用编译安装。。。。。

–获得安装包,从网上直接下载或者其他途径,这里直接wget # wgethttp://curl.haxx.se/download/curl-7.17.1.tar.gz –解压到当前目录 # tar -zxf curl-7.17.1.tar.gz –进入解压后的目录内 # cd curl-7.17.1 –配置,指定安装的目录,这里是“/usr/local/curl” # ./configure –PRefix=/usr/local/curl – # make –安装 # make install –安装完毕

使用: 将curl命令加入环境变量, 命令行里执行(仅对本会话起作用,或者在.bash_profile、.bashrc文件里配置环境变量): # export PATH=$PATH:/usr/local/curl/bin 然后就可以使用了

其他的没有安装的包自己找源下载后编译安装。。。。

现在安装php:

cd /home/oldboy/tools/

wget http://mirrors.sohu.com/php/php-5.3.27.tar.gz

tar -zxf php-5.3.27.tar.gz 

cd php-5.3.27

./configure \

--prefix=/application/php5.3.27

--with-apxs2=/application/apache/bin/apxs

--with-MySQL=mysqlnd \

--with-pdo-mysql=mysqlnd  \

--with-iconv-dir=/usr/local/libiconv \

--with-freetype-dir \

--with-jpeg-dir \

--with-zlib \

--disable-rpath \

--enable-safe-mode \

--enable-bcmath \

--enable-shmop \

--enable-sysvsem \

--enable-inline-optimization \

--with-curl \

--with-curlwrappers \

--enable-mbstring \

--with-mcrypt \

--with-gd \

--enable--gd-native-ttf \

--with-openssl \

--with-mhash \

--enable-sockets \

--with-xmlrpc \

--enable-zip \

--enable-soap \

--enable-short-tags \

--enable-zend-multibyte \

--enable-static \

--with-xsl \

--enable-ftp