我已将其正确添加到 PATH 中, 在配置文件中,我以这种方式添加了代码片段:
PHPIniDir "C:/Web/php8"
AddHandler application/x-httpd-php .php
LoadModule php8_module "C:/Web/php8/php8apache2_4.dll"
我查看了 apache 文件中的错误日志,但似乎无法真正理解任何内容。这是错误日志显示的内容:
AH00455: Apache/2.4.52 (Win64) configured -- resuming normal operations
AH00456: Apache Lounge VS16 Server built: Dec 17 2021 10:17:38
AH00094: Command line: 'C:\\Web\\Apache24\\bin\\httpd.exe -d C:/Web/Apache24'
AH00418: Parent: Created child process 4284
AH00354: Child: Starting 64 worker threads.
AH00422: Parent: Received shutdown signal -- Shutting down the server.
AH00364: Child: All worker threads have exited.
AH00430: Parent: Child process 4284 exited successfully.
这些消息基本上是在同一时间跨度内出现的。编辑:我尝试从 cmd 启动 httpd,它给了我这个错误:
httpd: Syntax error on line 540 of C:/Web/Apache24/conf/httpd.conf: Can't locate API module structure `php8_module' in file C:/Web/php8/php8apache2_4.dll: No error
那么,为什么我安装了 php 后 apache 无法启动?编辑编辑: 我找到了解决方案:您必须将“php8_module”更改为“php_module”。现在效果很好。