windows - Windows 10,XAMPP Apache 在 PHP 从 7.3 更新到 7.4 后无法启动
问题描述
我试图为我的 on更新PHP7.3
到. 现在不会开始...PHP7.4
XAMPP Apache
Windows 10
Apache
我正在使用自签名安全证书进行开发。
我从 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.
- 从http://windows.php.net下载 Thread Safe PHP 版本
- 解压缩,将文件夹重命名为 PHP
- 在 XAMPP 中重命名 php 文件夹(所以我现在是 php_7.3)
- 插入新的 php 文件夹
- 在这个新的 php 文件夹中,我将 php.ini.development 重命名为 php.ini
- 然后我替换了我的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.dll
:php7ts.dll cannot load into server
所以我运行了命令httpd.exe -v
和php.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
解决方案
确认您的确认 php7ts.dll 文件位置并在 apache httpd 配置文件中使用相同的位置。
推荐阅读
- javascript - JavaScript 函数可以在没有 onclick 的情况下调用?
- ruby - windows 7 运行 ruby.exe 与 ruby 的区别
- python - 如何检查坐标网格中是否存在坐标对(纬度,经度)?
- powershell - Powershell 聚合嵌套数组值
- ios - 地点选择器已禁用,但仍发布实施指南
- jquery - 动态更改选择的代码,也可以在 Safari 中使用
- android - 通过标准模板与 Prism 模板创建 Xamarin 表单项目时出现资源错误
- arm - ARM 汇编语言指令中的排列说明符(.16b,.8b) 是什么?
- c - 当写入器比读取器快时 C FIFO 崩溃
- wpf - 跨应用程序域边界 WPF 调用命令