在 Windows 7 上的 Apache 2.2 上安装 PHP
我在 Windows 上安装了 Apache 2.2。现在我刚刚在 Apache 服务器上安装完 PHP。正如说明所示,我需要编辑 Apache 的 httpd.conf 并添加:
#
LoadModule php5_module "G:\Program Files\PHP\php5apache2_2.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "G:\Program Files\PHP"
我确保目录是正确的。然后我再次重新启动我的服务器。我的 htdocs 中有一个 hello.php 文件。我导航到 localhost:8080/hello.php ,它说找不到服务器,但是当我执行 index.html 时。它在 htdocs 文件夹中正确显示 html。
我在这里做错了什么?我尝试通过执行 G:\Program Files\PHP\php-cgi hello.php 从命令行执行 hello.php 来调试此问题,但随后它说:
'G:\Program 未被识别为内部或外部命令.....
I had my Apache 2.2 installed on windows. Now I just finished installing PHP on the Apache server. As the instruction says, I need to edit the httpd.conf of my Apache and add:
#
LoadModule php5_module "G:\Program Files\PHP\php5apache2_2.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "G:\Program Files\PHP"
I made sure the directory is correct. Then I restart my server again. I have a hello.php file in my htdocs. And I navigate to localhost:8080/hello.php and it says server not found, however when I do index.html. It display's the html correctly on the htdocs folder.
What am I doing wrong here? I tried to debug this by trying to execute hello.php from the command line by executing G:\Program Files\PHP\php-cgi hello.php, but then it says:
'G:\Program is not recognized as internal or external command.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用像 XAMPP 这样的配置,它很容易配置。
You can use some this like XAMPP its easy to configuration.