12/12 いただいたメッセージへのご返信はこちら

XAMPPが「Apache shutdown unexpectedly.~」エラーで起動しなくなった時の解決方法

XAMPPが「Apache shutdown unexpectedly.~」エラーで起動しなくなった時の解決方法

今まで普通に使えていたXAMPPが、急にエラーで起動しなくなりました。
原因が分かったので、備忘録としてまとめておきます。

XAMPPのコントロールパネルからApacheを起動しようと「start」ボタンを押したところ
Error: Apache shutdown unexpectedly.
This may be due to a blocked port, missing dependencies, 
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums


とエラーが出て、Apacheが起動しなくなりました。

MySQLは起動するため、Apacheに問題があるという予想はつきました。

最近、XAMPPのApacheのhttpd-vhosts.confをいじったので、その辺りだろうと考えてチェックしてみました。


<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\test.com\public_html"
ServerName local.test.com
ErrorLog "logs\local.test.com-error.log"
CustomLog "ogs\local.test.com-access.log" common
<Directory "C:\xampp\htdocs\test.com\public_html">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


上のコードに間違いがあり、それがエラーの原因でした。

エラーログの出力のために
「CustomLog “logs\local.test.com-access.log" common」
と入力すべきところを、
「CustomLog “ogs\local.test.com-access.log" common」

と、パスを間違えて入力しており、それが原因でした。

正しいパスを入力すると「Apache shutdown unexpectedly.~」エラーは消えました。
この記事を書いた人
せみやま せみやま
生き物が大好きなWebエンジニアです。
身近な自然を楽しみながら暮らしています。

生き物とサブカルのポッドキャスト「セミラジオ」を配信中です!

詳細なプロフィール