0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacでLaravel環境構築

Posted at

MacでLaravelのローカル環境を構築したのでメモ。

1.phpをインストール

brew install php@7.2

export PATH="$(brew --prefix php@7.2)/bin:$PATH"

2.composerをインストール

・ターミナルより以下を実行

brew install homebrew/core/composer

Updating Homebrew...
==> Downloading https://getcomposer.org/download/1.8.5/composer.phar
:

PHPも勝手にインストールされる?

3.larevelをインストールする

brew install homebrew/core/composer

Updating Homebrew...
==> Downloading https://getcomposer.org/download/1.8.5/composer.phar
:

4.composerのパスを通す

.bash_profileに追加

export PATH="$PATH:$HOME/.composer/vendor/bin"
source .bash_profile

5.プロジェクト作成

・プロジェクトを作成したいディレクトリに移動し、プロジェクト作成コマンドを実行する。

cd {test project dir}
laravel new {new project name}

----
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 76 installs, 0 updates, 0 removals
  - Installing doctrine/inflector (v1.3.0): Downloading (100%)
  - Installing doctrine/lexer (v1.0.1): Downloading (100%)
  - Installing dragonmantank/cron-expression (v2.3.0): Downloading (100%)
  - Installing erusev/parsedown (1.7.3): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.11.0): Loading from cach
 :

6.ローカルサーバー起動

・以下のコマンドを実行する。

cd {created project dir}
php artisan serve

ar-mac-007:asoview-test ar-mac-007$  php artisan serve
Laravel development server started: <http://127.0.0.1:8000>

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?