简体   繁体   English

在Windows 7的Apache 2.2上安装PHP

[英]installing PHP on Apache 2.2 on Windows 7

I had my Apache 2.2 installed on windows. 我在Windows上安装了Apache 2.2。 Now I just finished installing PHP on the Apache server. 现在,我刚完成在Apache服务器上安装PHP。 As the instruction says, I need to edit the httpd.conf of my Apache and add: 如指令所述,我需要编辑Apache的httpd.conf并添加:

# 
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. 我的htdocs中有一个hello.php文件。 And I navigate to localhost:8080/hello.php and it says server not found, however when I do index.html. 然后我导航到localhost:8080 / hello.php并且它说找不到服务器,但是当我做index.html时。 It display's the html correctly on the htdocs folder. 它会在htdocs文件夹上正确显示html。

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 Files \\ PHP \\ php-cgi hello.php来执行hello.php调试,但是它说:

'G:\\Program is not recognized as internal or external command..... 'G:\\ Program不被识别为内部或外部命令.....

您可以像XAMPP一样使用它,它易于配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM