安裝PHPphp-5.4.4
一、下載PHPphp-5.4.4
[root@aliyun software]# pwd
/software
[root@aliyun software]# wget http://mirrors.sohu.com/php/php-5.4.44.tar.gz
二、解壓php-5.4.44.tar.gz
[root@aliyun software]# tar -xzvf php-5.4.44.tar.gz
三、./configure make make install
[root@aliyun php-5.4.44]# pwd
/software/php-5.4.44
[root@aliyun php-5.4.44]# ./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-mysqli=/usr/local/mysql/bin/mysql_config --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 --with-curl --with-openssl --with-zlib-dir --enable-ftp
make
make install
四、源碼安裝 Apache+PHP 整合
整合 apache+php 環境,修改 httpd.conf 配置文件,然後加入如下語句:
LoadModule php5_module modules/libphp5.so (默認已存在)
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html (把 index.php 加入 index.html 之前)
五、然後在/usr/local/apache/htdocs 目錄下創建 index.php 測試頁面,執行如下 命令:
cat >>/usr/local/apache/htdocs/index.php < EOF
重新啟動 apache 服務,通過 IP 訪問界面如下圖,即代表 LAMP 環境搭建成功。
安裝PHPphp-5.4.4