解壓文件 tar -zxvf php-5.4.5.tar.gz
cd 到 php-5.4.5 目錄
配置安裝文件:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr --enable-ftp --with-zlib --with-jpeg-dir --with-png-dir --with-gd --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --with-iconv
--prefix=/usr/local/php5 php 安裝目錄
--with-apxs2=/usr/local/apache/bin/apxs apache 安裝目錄文件下的apxs 文件 。(將會在apache目錄下的modules 生成libphp5.so)
--with-config-file-path=/usr/local/php5/etc php.ini 配置文件目錄,安裝完成後如果沒有, 、找到 php.ini-production 拷貝到該目錄
--with-mysql=/usr mysql 目錄文件
--enable-ftp --with-zlib --with-jpeg-dir --with-png-dir --with-gd --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --with-iconv gd,ftp 等擴展
--prefix 指php 安裝路徑 --with-apxs2指 apache 安裝的路徑apxs位置。 --with-mysql 指mysql所在目錄。