XAMPPをインストールし、Apacheを開始しようとすると起動できません。
インストールからエラー発生まで
- XAMPPをインストール(Windows向けXAMPP 7.3.2(PHP 7.3.2))
インストール場所:C:\xampp
2.ドキュメントルートの設定のため、
C:\xampp\htdocs にstudy.localhostフォルダを作成。
C:\xampp\apache\conf\extra\httpd-vhosts.conf に以下を記入(初期のコメント等はすべて削除)
(パーフェクトPHPという書籍のp.28~p.29を参考にしています)
NameVirtualHost *:80
<VitrualHost *:80>
ServerName study.localhost
DocumentRoot "C:/xampp/htdocs/study.localhost"
DirectoryIndex index.php index.html
</VirtualHost><Directory "C:/xampp/htdocs/study.localhost"> AllowOverride All Allow from All </Directory>
管理者権限でXAMPPを起動、Apacheの「Start」をクリック
発生している問題・エラーメッセージ
12:15:28 [Apache] Error: Apache shutdown unexpectedly.
12:15:28 [Apache] This may be due to a blocked port, missing dependencies,
12:15:28 [Apache] improper privileges, a crash, or a shutdown by another method.
12:15:28 [Apache] Press the Logs button to view error logs and check
12:15:28 [Apache] the Windows Event Viewer for more clues
12:15:28 [Apache] If you need more help, copy and post this
12:15:28 [Apache] entire log window on the forums
error.logには何も出力されてません。
試したこと
httpd-vhosts.confの中身を全削除したところ、Apacheが起動できました。
Ports(s)には 「80, 443」とあります。
しかし上記の設定を記入すると、起動できなくなります。
「 *:80」の部分を他の数字に変えても、同様のエラーメッセージで起動できません。
skype等のポート競合は起こしていないことを確認済です。
【追記】
C:\xampp\apache\conf\httpd.confを下記手順により編集し、ポート81を使うようにしてみましたが、
やはり同様のエラーになりました。
httpd-vhosts.confが無記入だとポート81,443を使用して通常起動しますが、
記入するとエラーとなります。
以下の2箇所を変更する。
Listen 80
↓
Listen 81
ServerName localhost:80
↓
ServerName localhost:81
【追記2】
netstat -naoにて80番ポートがないか確認済み、
IISも無効にしています。
試しにhttpd-vhosts.confの内容を
「<VitrualHost *:80>
</VirtualHost>」
のみにしてみましたが、これでもエラーとなりました。
再インストールもしてみましたが、ダメでした…。
補足情報(FW/ツールのバージョンなど)
OS:Windows10
ご教示のほど、よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー