XAMPP - Apache could not start - Attempting to start Apache service

后端 未结 20 1856
悲哀的现实
悲哀的现实 2020-12-31 09:27

While trying to start Apache using XAMPP, I was receiving - \"Attempting to start Apache service...\" message in XAMPP UI. No further details were availabl

20条回答
  •  天命终不由人
    2020-12-31 09:57

    For me it wasn't a port or service issue; I had to re-run the XAMPP setup script. Although this didn't directly fix the issue for me, the script was much more verbose than the XAMPP log, pointing me in the right direction to actually solve the problem.

    From the XAMPP GUI, click on Shell, type set, press Tab to autocomplete to the setup_xampp.bat file, and then press Enter to run it.

    In my case I got the following output:

    [ERROR]: Test php.exe failed !!!
    [ERROR]: Perhaps the Microsoft C++ 2008 runtime package is not installed.
    [ERROR]: Please try to install the MS VC++ 2008 Redistributable Package from the Mircrosoft page first
    [ERROR]: http://www.microsoft.com/en-us/download/details.aspx?id=5582
    

    This particular error is misleading. Although it specifies the Visual C++ 2008 Redistributable Package, PHP 7.4.x requires the Visual C++ 2019 Redistributable Package.

    After installing that and following the prompt to restart, sure enough I'm now able to start Apache as normal.

提交回复
热议问题