dongshadu4498 2012-02-19 15:30
浏览 19
已采纳

在Win7 PC上使用Apache安装PHP5

I have installed Apache 2.2 and PHP5 in my laptop. Apache seems to work fine. When I view a php page the text in the html body section displays fine but the php section does not get displayed at all. I am thinking I must have missed some entry in the apache config file to tell it where PHP is installed?

Apache c:\server\apache2 PHP c:=Program Files\PHP

simple example

    <html>
    <body>
     See this line
     <?php
     echo "Hello World";
     ?>
     </body>
     </html>

Can anyone offer some suggestion?

Thanks Dan

  • 写回答

2条回答 默认 最新

  • dsxon40042 2012-02-19 15:33
    关注

    You need to tell Apache to load the php5 module and the mime types. In httpd.conf add:

    LoadModule php5_module "c:/path/to/php5apache2_2.dll"
    AddHandler application/x-httpd-php .php
    

    then restart Apache.

    see: http://php.net/manual/en/install.windows.apache2.php

    Alternatively just use a pre-configured solution like WAMP

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效