Windows10で XAMPP PortableでApacheが起動できなかった

久々にXAMPP を使いたいと思いDLしたが、ハマったのでメモ

結論:readmeをちゃんと読もう

昔使ったときにXAMPPは、xampp-control.exeを起動してApacheやMySQLをStartするとすぐに利用できる認識なのでreadmeも何も読まずに実行してみたがうまくいかず。

ログ

13:50:56  [Apache]   Attempting to start Apache app...
13:50:57  [Apache]  Status change detected: running
13:50:57  [Apache]  Status change detected: stopped
13:50:57  [Apache]  Error: Apache shutdown unexpectedly.
13:50:57  [Apache]  This may be due to a blocked port, missing dependencies, 
13:50:57  [Apache]  improper privileges, a crash, or a shutdown by another method.
13:50:57  [Apache]  Press the Logs button to view error logs and check
13:50:57  [Apache]  the Windows Event Viewer for more clues
13:50:57  [Apache]  If you need more help, copy and post this
13:50:57  [Apache]  entire log window on the forums

ポートが利用されているのかと思い、 xampp-control.exe付属の Netstatで確認してみるも 80, 443どちらも利用されておらず。 FWと思ったがそもそもWindowsの標準FWのダイアログがstart時に表示されていないし、管理者権限でxampp-control.exe起動してみてもダメだった。

WindowsのイベントビューアーやApacheのログを確認してみたが、特にめぼしいログは確認できず。

ここで readme_en.txtを読むと以下のように記載されていた。

* QUICK INSTALLATION:

[NOTE: Unpack the package to your USB stick or a partition of your choice.
There it must be on the highest level like E:\ or W:\. It will
build E:\xampp or W:\xampp or something like this. Please do not use the "setup_xampp.bat" for an USB stick installation!]

Step 1: Unpack the package into a directory of your choice. Please start the
"setup_xampp.bat" and beginning the installation. Note: XAMPP makes no entries in the windows registry and no settings for the system variables.

Step 2: If installation ends successfully, start the Apache 2 with
"apache_start".bat", MySQL with "mysql_start".bat". Stop the MySQL Server with "mysql_stop.bat". For shutdown the Apache HTTPD, only close the Apache Command (CMD). Or use the fine XAMPP Control Panel with double-click on "xampp-control.exe"!

Step 3: Start your browser and type http://127.0.0.1 or http://localhost in the location bar. You should see our pre-made
start page with certain examples and test screens.

Step 4: PHP (with mod_php, as *.php), Perl by default with *.cgi, SSI with *.shtml are all located in => C:\xampp\htdocs\.
Examples:
- C:\xampp\htdocs\test.php => http://localhost/test.php
- C:\xampp\htdocs\myhome\test.php => http://localhost/myhome/test.php

Step 5: XAMPP UNINSTALL? Simply remove the "xampp" Directory.
But before please shutdown the apache and mysql.

setup_xampp.bat実行してねって書いてあった。実行後、xampp-control.exeからApache、MySQLどちらもstartで動かすことができた。