RedHat Enterprise Linux 5下配置Apache+Mysql+Php

2020-01-30 11:29:17于海丽

Php.ini文件的修改
#cp php.ini.dist /usr/local/lib/
查找修改extension_dir='./'的内容
extension_dir = /usr/local/lib
extension=libpdf_php.so
保存退出

最后修改apache配置文件httpd.conf
#vi /usr/local/apache2/conf/httpd.conf
查找AddType 大约在DefaultType text/plain

输入如下内容
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
(不清楚是不是必须输入这么多项)
查找DirectoryIndex index.html 在其后输入 index.php
保存文件,退出。
测试php,创建info.php文件放到网站的目录下,我这里是/usr/local/apapche2/htdocs
内容如下