Apache 服务器在尝试将其配置为使用 php 运行后无法启动

发布于 2024-11-10 15:30:28 字数 561 浏览 1 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空‖城人不在 2024-11-17 15:30:28

我没有在 Windows 上安装它的任何经验,但以下几行对我来说似乎非常错误:

PHPIniDir “C:\PHP”
LoadModule php5_module “C:\PHP\php5apache2_2.dll”

这真的是您添加的吗?如果是,我建议将其更改为:

PHPIniDir "C:\PHP"
LoadModule php5_module "C:\PHP\php5apache2_2.dll"

请注意,我使用的是 " 而不是您正在使用的大引号。

I don´t have any experience with installing it on windows, but the following lines seem very wrong to me:

PHPIniDir “C:\PHP”
LoadModule php5_module “C:\PHP\php5apache2_2.dll”

Is that really what you added? If it is, I would suggest changing it to:

PHPIniDir "C:\PHP"
LoadModule php5_module "C:\PHP\php5apache2_2.dll"

Note that I am using " instead of the curly quotes you are using.

不知所踪 2024-11-17 15:30:28

如果您遇到问题,我建议您下载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.

花想c 2024-11-17 15:30:28

通常,这就是您在 Apache 下设置 PHP 的方式...

(根据您的路径进行调整)

LoadFile "D:/WampDeveloper/Components/Php/php5ts.dll"
LoadModule php5_module "D:/WampDeveloper/Components/Php/php5apache2_2.dll

<IfModule php5_module>

PHPIniDir "D:/WampDeveloper/Config/Php"

    <Directory "D:/WampDeveloper/Websites/*/webroot">
        AddType text/html .php .php4 .php5 .phps
        AddHandler application/x-httpd-php .php .php4 .php5
        AddHandler application/x-httpd-php-source .phps
    </Directory>
</IfModule>

您最好使用适用于 Windows 的预制 Apache、PHP 和 MySQL 解决方案。

XAMPP

WampServer

WampDeveloper Pro

Normaly, this is how you would set up PHP under Apache...

(adjust for your paths)

LoadFile "D:/WampDeveloper/Components/Php/php5ts.dll"
LoadModule php5_module "D:/WampDeveloper/Components/Php/php5apache2_2.dll

<IfModule php5_module>

PHPIniDir "D:/WampDeveloper/Config/Php"

    <Directory "D:/WampDeveloper/Websites/*/webroot">
        AddType text/html .php .php4 .php5 .phps
        AddHandler application/x-httpd-php .php .php4 .php5
        AddHandler application/x-httpd-php-source .phps
    </Directory>
</IfModule>

You will do better to use a pre-made Apache, PHP, and MySQL solution for Windows.

XAMPP

WampServer

WampDeveloper Pro

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文