Home > php教程 > php手册 > body text

安装apache2.2.22配置php5.4(具体操作步骤)

WBOY
Release: 2016-06-13 11:44:49
Original
1038 people have browsed it

修改 apache2.2/httpd.conf 配置文件,让apache能够解析php文件

#修改监听端口
Listen 8011

#在LoadModule的最后一段后面添加下面一句话
LoadModule php5_module "E:/LAMP/php5.4/php5apache2_2.dll"

#修改服务器网站目录为 E:/LAMP/www
DocumentRoot "E:/LAMP/www"
#同时还有一个地方要改

#在里面的index.html前面添加index.php,即默认先打开index.php,如果没有才再打开index.html

DirectoryIndex index.php index.html

#添加可执行的文件在 AddType application/x-gzip .gz .tgz 后面添加下面两句话
AddType application/x-httpd-php .php .phtml
PHPIniDir "E:/LAMP/php5.4"

修改 php5.4/php.ini-production 配置文件
先将php.ini-production文件重命名为php.ini

;设置php的扩展库路径,找到 ; extension_dir = "ext",在下面添加以下一句话
extension_dir = "E:/LAMP/php5.4/ext"

;开启php扩展库
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;将上面四句话前面的分号去掉

;设置session临时保存路径,找到;session.save_path = "/tmp",在下面添加以下一句话(路径可以自由设置)
session.save_path = "E:/LAMP/php5.4/session_temp"

;同样cookie临时保存路径
session.cookie_path = "E:/LAMP/php5.4/session_temp"

配置完之后,再将 E:LAMPphp5.4ext 目录下的
php_mysql.dll 和 php_mysqli.dll
两个文件复制粘贴到“C:WindowsSystem32”目录中,
如果你的操作系统是win7x64位的,则复制粘贴到“C:WindowsSysWOW64”目录中。

ok,现在重启一下你的apache,看看是不是能用了。
测试运行一下phpmyadmin,看看能不能运行。如果能正常运行,则大功告成了。

注意:这里没有提供mysql的安装方法。之前没有安装mysql的话,自己另外百度去吧。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!