4.安装php
4.1 需要支持mysql, SNMP, XML, Session, Sockets,在 configure时添加对应参数
4.2 wget
4.3 tar zvxf php-5.3.10.tar.gz
4.4 cd php-5.3.10
4.5 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-xml-config=/usr/local/lib --with-config-file-path=/usr/local/php/etc --with-snmp=/usr/local -enable-xml --enable-sockets
4.6 cp php.ini-production /usr/local/php/etc/php.ini
4.7 修改php时区设置:vi /usr/local/php/etc/php.ini ,否则下面cacti安装之后主页面报global_constants.php等页面的date()函数错误
[Date]
; Defines the default timezone used by the date functions
;
date.timezone = Asia/Chongqing
4.7 apache支持php,vi /usr/local/apache/conf/httpd.conf
在AddType application/x-gzip .gz .tgz下添加两项:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
4.8 测试php是否ok,vi /usr/local/apache/htdocs/index.php
<?phpinfo();?>
如果显示如下信息说明php安装ok