1、查看环境
#rpm -qa|grep php
得知系统默认没有安装php
2.安装程序
插入光盘2
#mount /dev/cdrom
#cd /media/cdrom/RedHat/RPMS
# rpm -ivh php-4.3.9-3.8.i386.rpm
warning: php-4.3.9-3.8.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
php-pear is needed by php-4.3.9-3.8.i386
Suggested resolutions:
php-pear-4.3.9-3.8.i386.rpm
系统提示需要先装php-pear-4.3.9-3.8.i386.rpm
#rpm -ivh php-pear-4.3.9-3.8.i386.rpm
warning: php-pear-4.3.9-3.8.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
php = 4.3.9-3.8 is needed by php-pear-4.3.9-3.8.i386
Suggested resolutions:
php-4.3.9-3.8.i386.rpm
系统又提示需要先装php-4.3.9-3.8.i386.rpm
又来了,跟apache一样,加上aid参数安装成功:
#rpm -ivh --aid php-4.3.9-3.8.i386.rpm
3、配置Apache以支持php
#vi /etc/httpd/conf/httpd.conf
找到"AddType"这节,在"#AddType application/x-tar .tgz"下面添加下一行使其支持php后缀名的解析
:
AddType application/x-httpd-php .php .phtml
重启apache:
#service httpd restart
4、运行
在/var/www/html目录编辑一个index.php测试,内容为:" echo phpinfo() ?>"
此时可在Windows下浏览,如无意外则应该出现"PHP Version 4.3.9"的页面,页面上
显示了你的php的配置信息,此表明php已配置成功。
更多信息请参见php手册。
|
文件: |
php.rar |
大小: |
0KB |
下载: |
下载 | |
阅读(1660) | 评论(0) | 转发(0) |