0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【MAMP】Laravel環境構築

Last updated at Posted at 2025-10-06

目的

WindowsにLaravel開発環境を構築する。

開発環境

  • OS:Windows 11
  • サーバ:MAMP for Windows
  • PHP:8.3.1
  • Laravel:10.24.0
  • エディタ:Visual Studio Code

事前準備

1, MAMPを公式サイトからダウンロード・インストール。

2, Visual Studio Codeを公式サイトからダウンロード・インストール。


PHPコマンドの設定

  1. MAMPのphp/php.exeのパスを確認。
  2. 「システム環境変数」→「Path」に追加。

Composerのインストール


Laravelのインストール

以下のコマンドを実行。

mkdir C:\Laravel
cd C:\Laravel
composer create-project --prefer-dist laravel/laravel example-app

MAMPのドキュメントルート設定

1, MAMP → Preferences → Web Server → Document Root を public フォルダに設定。
2, ブラウザで http://localhost:8889 を開き、ウェルカムページを確認。


MySQL連携

  1. phpMyAdminでデータベースを作成。
  2. .env に以下を設定:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=8889
DB_DATABASE=作成したデータベース名
DB_USERNAME=root
DB_PASSWORD=root

マイグレーションを実行し、テーブルが作成されるのを確認して完了。

php artisan migrate

参考・引用

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?