Apache 2.2 未加载 PHP 5.5 模块


Apache 2.2 not loading PHP 5.5 module

关于

这个问题有几个问题,但我已经用尽了所有修复程序,但这仍然不起作用。

我正在使用Windows 7操作系统(愚蠢,我知道)。

基本上我下载了PHP 5.2.5并安装了VC6(VC9及以后有一些问题,无法与Apache 2.2一起使用)。我编辑了 php.ini 文件以添加以下内容:

extension_dir = "C:/php/ext/"
extension = php5apache2_2.dll
extension = php5ts.dll

然后,我将php5apache2_2.dll和php5ts.dll文件添加到C:/php/ext/目录中。这些没有随PHP下载一起提供...我不得不在网上随机找到它们。这可能是一个问题吗?

第一个扩展是 Apache 2.2 的 PHP 模块。下一个是我在几篇博客文章中发现的,有时不存在,需要添加 PHP 才能与 Apache 一起使用。

在 Apache 2.2 httpd.conf 文件中,我添加了:

LoadModule php5_module "C:/php/ext/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
PHPIniDir "C:/php/"

这些都在适当的地方,等等。我还设置了目录索引以包含索引.php

是的,一切都在正确的路径/正确的文件夹中。

当我重新启动 Apache 时,除非我注释掉 PHPIniDir 行,否则它永远不会重新启动。我得到的错误日志是:

Invalid command 'PHPIniDir', perhaps misspelled or defined by a module not included in        the server configuration

我开始对所有所谓的"修复"感到有点迷茫,并且害怕进入我的头脑并搞砸我的计算机(一些建议涉及在 system32 文件夹中粘贴内容等)。

谁能帮忙??

删除下面行的最后一个斜杠:

PHPIniDir "C:/php/"