Home > Backend Development > PHP Tutorial > apahce 与 php调整

apahce 与 php调整

WBOY
Release: 2016-06-13 13:06:22
Original
840 people have browsed it

apahce 与 php整合
整合apache和php

1.修改apache的配置文件httpd.conf

1)在httpd.conf文件中找到有很多LoadModule的地方,在最后加上如下语句:
  LoadModule php5_module E:/soft_work/PHP/php5apache2_2.dll
  AddType application/x-httpd-php .php

  PHPIniDir "E:/soft_work/PHP"

2)修改DirectoryIndex,加上index.php

3)在apache目录下的htdocs中新建一个目录myphp,然后在该目录下建立一个index.php文件,内容如下:
phpinfo(); ?>

3)重启apache,然后在浏览器中输入http://localhost/myphp,如果能出结果则表明apache和php整合成功

补充: 如果想改变站点的目录,修改 httpd.conf
设置站点根目录,将原来的
DocumentRoot "E:/soft_work/Apache Http Server/htdocs"改为:
DocumentRoot "D:/site"

改为:


Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template