1.下载PHP
http://php.net/releases/index.php
2.PHP安装
# gzip -dc php-4.4.8.tar.gz | tar xf -
# cd php-4.4.8
# ./configure --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql \
> –-with-mcrypt=/usr/local/libmcrypt --with-gd=/usr/local \
> --enable-track-vars --enable-mbstring --enable-mbregex --enable-zend-multibyte \
> --enable-gd-native-ttf --enable-gd-jis-conv --enable-module=so
> --with-apxs2=/usr/apache2/bin/apxs
# make
# make install
3.复制PHP初始设定文件
# cp php.ini-dist /usr/local/lib/php.ini
注意:
先安装Apache,再装PHP
装完PHP后,去看apache的配置文件httpd.conf
里面有一句:
LoadModule php4_module libexec/libphp4.so
如果没有,手动加上