首页 > 解决方案 > Windows 10,XAMPP Apache 在 PHP 从 7.3 更新到 7.4 后无法启动

问题描述

我试图为我的 on更新PHP7.3到. 现在不会开始...PHP7.4XAMPP ApacheWindows 10Apache

我正在使用自签名安全证书进行开发。

我从 Apache 收到的错误消息是:

10:30:53 AM  [Apache]   Attempting to start Apache app...
10:30:53 AM  [Apache]   Status change detected: running
10:30:54 AM  [Apache]   Status change detected: stopped
10:30:54 AM  [Apache]   Error: Apache shutdown unexpectedly.
10:30:54 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
10:30:54 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
10:30:54 AM  [Apache]   Press the Logs button to view error logs and check
10:30:54 AM  [Apache]   the Windows Event Viewer for more clues
10:30:54 AM  [Apache]   If you need more help, copy and post this
10:30:54 AM  [Apache]   entire log window on the forums

这些是最新的错误日志条目:

[Thu Jun 18 09:50:08.253500 2020] [ssl:warn] [pid 3120:tid 520] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Jun 18 09:50:08.253500 2020] [ssl:warn] [pid 3120:tid 520] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 18 09:50:08.278953 2020] [mpm_winnt:notice] [pid 3120:tid 520] AH00354: Child: Starting 150 worker threads.

我遵循了本教程: https ://medium.com/oceanize-geeks/how-to-upgrade-lower-version-to-latest-php-version-in-xampp-on-windows-f7be9a70bbb0

  1. 从http://windows.php.net下载 Thread Safe PHP 版本
  2. 解压缩,将文件夹重命名为 PHP
  3. 在 XAMPP 中重命名 php 文件夹(所以我现在是 php_7.3)
  4. 插入新的 php 文件夹
  5. 在这个新的 php 文件夹中,我将 php.ini.development 重命名为 php.ini
  6. 然后我替换了我的PHP模块行httpd-xamp.conf如下:
LoadFile "D:/xampp/php/php7ts.dll"
LoadFile "D:/xampp/php/libpq.dll"
LoadModule php7_module "D:/xampp/php/php7apache2_4.dll"

我不知道该怎么做,担心我会把它弄得更糟......非常感谢帮助!我真的需要Apache来工作......

编辑:

这是今天完整的错误日志:

[Thu Jun 18 09:50:07.558720 2020] [ssl:warn] [pid 17248:tid 512] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Jun 18 09:50:07.559723 2020] [ssl:warn] [pid 17248:tid 512] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 18 09:50:07.611001 2020] [core:warn] [pid 17248:tid 512] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Jun 18 09:50:07.613027 2020] [ssl:warn] [pid 17248:tid 512] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Jun 18 09:50:07.613027 2020] [ssl:warn] [pid 17248:tid 512] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 18 09:50:07.648936 2020] [mpm_winnt:notice] [pid 17248:tid 512] AH00455: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.11 configured -- resuming normal operations
[Thu Jun 18 09:50:07.648936 2020] [mpm_winnt:notice] [pid 17248:tid 512] AH00456: Apache Lounge VC15 Server built: Aug 11 2019 12:20:04
[Thu Jun 18 09:50:07.648936 2020] [core:notice] [pid 17248:tid 512] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Jun 18 09:50:07.655110 2020] [mpm_winnt:notice] [pid 17248:tid 512] AH00418: Parent: Created child process 3120
[Thu Jun 18 09:50:08.205628 2020] [ssl:warn] [pid 3120:tid 520] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Jun 18 09:50:08.206625 2020] [ssl:warn] [pid 3120:tid 520] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 18 09:50:08.253500 2020] [ssl:warn] [pid 3120:tid 520] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Jun 18 09:50:08.253500 2020] [ssl:warn] [pid 3120:tid 520] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Jun 18 09:50:08.278953 2020] [mpm_winnt:notice] [pid 3120:tid 520] AH00354: Child: Starting 150 worker threads.

编辑2:

通过 Windows 命令提示符运行httpd.exe和命令的结果:httpd.exe -t

"httpd.exe: Syntax error on line 537 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 17 of C:/xampp/apache/conf/extra/httpd-xampp.conf: Cannot load D:/xampp/php/php7ts.dll into server: The specified module could not be found."

第 537 行httpd.conf是:

# XAMPP settings
Include "conf/extra/httpd-xampp.conf"

http-xampp.conf 中的第 17 行是:

LoadFile "D:/xampp/php/php7ts.dll"

进一步的研究让我想到了这个问题php7ts.dllphp7ts.dll cannot load into server

所以我运行了命令httpd.exe -vphp.exe -v. 结果是它们都是 64 位版本,我认为:

C:\xampp\apache\bin>httpd.exe -v
Server version: Apache/2.4.41 (Win64)
Apache Lounge VC15 Server built:   Aug 11 2019 12:20:04

C:\xampp\apache\bin>php.exe -v
PHP 7.4.7 (cli) (built: Jun  9 2020 13:36:15) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

标签: windowsapache

解决方案


确认您的确认 php7ts.dll 文件位置并在 apache httpd 配置文件中使用相同的位置。


推荐阅读