配置php
]# cd /usr/local/src/ 进入str 下载的文件基本上都在这个文件夹先
[root@localhost src]# wget http://cn2.php.net/distributions/php-5.4.36.tar.bz2 下载网址
#yum install -y libml2-devel
#yum install -y openssl openssl-devel
#yum install -y bzip2 bzip2-devel
#yum install -y libpng libpng-devel
#yum install -y freetype freetype-devel
#yum install -y libmcrypt-devel
#yum install -y libxml2
#yum install -y libxml2-devel libjpeg-devel
#tar jxf php-5.4.36.tar.bz2
解压 文件
#cd php-5.4.36
#./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/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
=============================================================================================
错误提示 提前走了,应该是断网了,没下载完吧
Warning: require_once(phar://install-pear-nozlib.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar "phar://install-pear-nozlib.phar/index.php" in /data0/software/php-5.4.25/pear/install-pear-nozlib.phar on line 1236
make[1]: *** [install-pear-installer] Error 255
make: *** [install-pear] E
=============================================================================================
执行yum install libtool-ltdl-devel
然后删除PHP解压目录,重新解压
---------------------------------------------------------------------------------------------
#make
#make install
# cp php.ini-production /usr/local/php/etc/php.ini 拷贝配置文件
# vim /usr/local/apache/conf/httpd.conf
AddType application/x-gzip .gz .tgz 找到这个大概在70%的地方
AddType application/x-httpd-php .php 在下面添加
<IfModule dir_module> 找到这个 (启动文件)
DirectoryIndex index.html
</IfModule>
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php 添加 index.htm index.php
</IfModule>
[root@localhost php-5.4.36]# pwd 查看当前目录
/usr/local/src/php-5.4.36