Apache 服务器在尝试将其配置为使用 php 运行后无法启动
我在 Vista 机器上安装了 apache 服务器 2.2.19。它运行良好,但我尝试通过修改 httpd.conf 文件将其配置为使用 php。这些是我添加的行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir “C:\PHP”
我在这一行下面添加了这一行
AddType application/x-gzip .gz .tgz
我还添加了这一行
LoadModule php5_module “C:\PHP\php5apache2_2.dll”
我在这一行下面添加了这一行
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
我尝试重新启动 apache 服务器,但每次这样做都会返回一条错误消息:请求的操作已失败。可能是什么问题?
I installed apache server 2.2.19 on a vista machine. It was running fine but I tried to configure it to use php by modifying the httpd.conf file. These are the lines I added
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir “C:\PHP”
I added this below this line
AddType application/x-gzip .gz .tgz
I also added this line
LoadModule php5_module “C:\PHP\php5apache2_2.dll”
I added this below this line
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
I tried to restart the apache server but every time i do so it returns an error message that The requested operation has failed. What could be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我没有在 Windows 上安装它的任何经验,但以下几行对我来说似乎非常错误:
这真的是您添加的吗?如果是,我建议将其更改为:
请注意,我使用的是
"
而不是您正在使用的大引号。I don´t have any experience with installing it on windows, but the following lines seem very wrong to me:
Is that really what you added? If it is, I would suggest changing it to:
Note that I am using
"
instead of the curly quotes you are using.如果您遇到问题,我建议您下载Xampp for Windows。它省去了安装单独组件的手动步骤。
If you are having problems I would suggest just downloading Xampp for Windows. It takes the manual steps out of installing the separate components.
通常,这就是您在 Apache 下设置 PHP 的方式...
(根据您的路径进行调整)
您最好使用适用于 Windows 的预制 Apache、PHP 和 MySQL 解决方案。
XAMPP
WampServer
WampDeveloper Pro
Normaly, this is how you would set up PHP under Apache...
(adjust for your paths)
You will do better to use a pre-made Apache, PHP, and MySQL solution for Windows.
XAMPP
WampServer
WampDeveloper Pro