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

Windows7 64位新系统中Apache2.4无法运行的解决方案求助

Solutions for Your Apache & XAMPP Issues on Windows 7 64-bit

Hey there, let’s work through your problems one by one to get your Drupal 8 development environment up and running smoothly.

First: Fix the "Port 80 in use by PID 4" Error

That PID 4 is almost always Windows' built-in HTTP.sys service, which handles system-level HTTP traffic (often tied to IIS, Windows Update, or other system services). Here are two reliable fixes:

Option 1: Reconfigure Apache to use different ports

This is the safest approach if you don’t want to mess with system services:

  • Open your XAMPP Apache config folder (usually C:\xampp\apache\conf).
  • Edit httpd.conf:
    • Change Listen 80 to Listen 8080
    • Change ServerName localhost:80 to ServerName localhost:8080
  • Edit httpd-ssl.conf (in conf/extra):
    • Change Listen 443 to Listen 4433
  • Restart Apache from the XAMPP control panel. Now you’ll access your local site at http://localhost:8080.

Option 2: Stop the service blocking Port 80

If you want to keep using Port 80:

  1. Open Command Prompt as Administrator.
  2. Run this command to confirm the service tied to PID 4:
    tasklist /svc /fi "PID eq 4"
    
    You’ll see it’s linked to HTTP.sys.
  3. Stop the associated services:
    • Open the Services manager (press Win+R, type services.msc).
    • Find World Wide Web Publishing Service (IIS) – if it’s running, stop it and set its startup type to Manual.
    • Also check for Windows Process Activation Service and stop it if needed.
  4. To prevent this from happening on reboot, run this admin command:
    sc config http start= disabled
    
    Note: This might affect some system features like Windows Update. If you run into issues later, revert it with sc config http start= auto.

Second: Fix the XAMPP 7.x "0xc000007b" Error

This error usually stems from 32/64-bit incompatibility or missing Visual C++ runtime libraries. Here’s how to fix it:

  1. Use a Win7-compatible XAMPP version: Newer XAMPP 7.x builds dropped support for Windows 7. Stick with XAMPP 7.2.x (the last version to support Win7) – make sure you download the 64-bit installer to match your system.
  2. Install required Visual C++ Redistributables: XAMPP 7.2 relies on the VC++ 2015-2019 Redistributable (64-bit). Download and install this from Microsoft’s official site.
  3. Reinstall XAMPP properly:
    • Delete any existing XAMPP folders to avoid leftover files.
    • Right-click the installer and select Run as Administrator.
    • Install to a path with no spaces or special characters (e.g., C:\xampp instead of C:\Program Files\XAMPP).

Alternative: Manually Set Up Apache 2.4 + PHP 5.5.9

If you prefer more control, you can build the environment manually to match Drupal 8’s requirements:

  • Download Apache 2.4 (64-bit, VC11 compiled – since PHP 5.5.9 uses VC11).
  • Download PHP 5.5.9 (64-bit, VC11, match the Thread Safe/Non-Thread Safe build to your Apache version).
  • Configure Apache’s httpd.conf to load the PHP module:
    LoadModule php5_module "C:/php/php5apache2_4.dll"
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/php"
    
  • Copy php.ini-development to php.ini and adjust settings like extension_dir to point to your PHP extensions folder.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 06:26:01