XAMPPの導入
以下の公式サイトからxamppをDLします
公式サイト
https://www.apachefriends.org/jp/download.html


OS X向けをDLします
PHPのバージョンにあったものをダウンロードします。
今回は一番上の通常盤の7.4.29~を選択しました。
上から3つが通常盤・下3つがVM版になってます。

DLが完了したらxampp-osx-x.x.x-x.appファイルをダブルクリックなどで開きます。


「XAMPPの開発元を確認できないため、開けません。」というメッセージが出た場合は
Macの左上のマーク→システム設定→プライバシーとセキュリティを開き下にスクロールすると「このまま開く」とあるのでこれをクリックします。


基本的にずっとNextでOKです。
私はLearn more about~のチェックは外しました。
XAMPPの使い方

ランチャーからアプリを起動


XAMPPを起動したらStartボタンを押下することによりApacheが起動できWebサーバとして使用できます。(アプリ起動時にApacheは起動されていると思います。)
止める時はStopで止められます。

ブラウザで http://localhost/dashboard/ を入力して上記の画像のようなページが表示されていればOKです。

アプリケーション→XAMPP→htdocs以下にhtmlファイルなどが配置されています。
ここにファイルを置くと先ほどブラウザで入力したURLでアクセスできます。
例としてhtdocks以下にtestHPというディレクトリを切って中にtest_HP.htmlというファイルを置いた場合は、http://localhost/testHP/test_HP.htmlと入力すると表示できます。
起動時にエラーが出た場合

XAMPP起動時に「cannot calculate MAC address: Using fd 16 for I/O notifications hv_vm_create unknown error 0x00000004」のようなエラーが出た場合は
VM版をインストールしている可能性がありますので、
通常版をDLして再度インストールを行なってください。
コメント