Home  >  Article  >  Backend Development  >  apahce 与 php调整

apahce 与 php调整

WBOY
WBOYOriginal
2016-06-13 13:06:22804browse

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"

改为:


Statement:
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