You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

XAMPP降级PHP从8.0到7.4后Apache意外终止的问题求助

Fix Apache Unexpected Shutdown After Downgrading PHP to 7.4 in XAMPP

Since Apache runs normally when you switch back to PHP 8.0, the issue is definitely tied to compatibility or misconfiguration between PHP 7.4 and your Apache setup. Let’s walk through targeted fixes to resolve this:

  • Verify PHP 7.4 Apache Module Loading
    Open your XAMPP Apache config file httpd.conf and double-check the PHP module references:

    • Replace any PHP 8.0 lines with the correct PHP 7.4 equivalents. For example:
      # Old PHP 8.0 line (comment out)
      # LoadModule php8_module "C:/xampp/php/php8apache2_4.dll"
      # New PHP 7.4 line
      LoadModule php7_module "C:/xampp/php74/php7apache2_4.dll"
      
    • Ensure the PHPIniDir path points to your PHP 7.4 directory:
      PHPIniDir "C:/xampp/php74"
      

    Note: Adjust the file paths to match where you’ve placed your PHP 7.4 files.

  • Check for Missing Dependencies
    PHP 7.4 relies on the Visual C++ Redistributable for Visual Studio 2017 (VC15). If this runtime library isn’t installed, Apache will crash due to missing dependencies. Install the correct bitness version (32-bit or 64-bit, matching your XAMPP/PHP architecture) and restart your computer.

    • You can also troubleshoot conflicting extensions: Temporarily comment out all extensions in php.ini (add a ; at the start of each extension line), then enable them one by one to identify which is causing the crash.
  • Confirm Architecture Match
    Make sure your PHP 7.4 version matches the bitness of your XAMPP installation:

    • 64-bit XAMPP requires 64-bit PHP 7.4
    • 32-bit XAMPP requires 32-bit PHP 7.4
      Mismatched architectures will cause Apache to fail silently or crash on startup.
  • Inspect Detailed Apache Error Logs
    The basic XAMPP control panel log is too vague—check the full Apache error log at xampp/apache/logs/error.log. Look for recent entries like Cannot load ... php7apache2_4.dll into server or specific extension load failures. These messages will pinpoint exactly what’s broken.

  • Use XAMPP’s Built-in Version Switcher (If Available)
    Some XAMPP versions include a built-in PHP version switcher in the control panel. Using this tool instead of manual configuration ensures all paths and module references are set correctly, eliminating human error.

内容的提问来源于stack exchange,提问作者EX_Zero

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 14:27:30