LoginSignup
1
2

More than 5 years have passed since last update.

macOS Sierra に Homebrew で PHP5.6 と 7.1 入れて、Symfony3.3 と Laravel5.5 をインストールするまでのメモ

Last updated at Posted at 2017-09-04

すぐ忘れちゃうから自分用のメモです

Install Homebrew

# 最初にXcodeをApp storeから落としてから、下のコマンドを叩く
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PHP

# 諸々入れとく
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php

# 先に5.6入れてUnlinkしてから7.1を入れる
brew install php56
brew unlink php56
brew install php71

# 5.6に戻したい時
brew unlink php71
brew link php56

Install Symfony(https://symfony.com/doc/current/setup.html)

# 入れないと、最後の動作チェックで怒られるから入れとく
brew install php56-intl
brew install php71-intl

# PHP Accelerator を有効化
brew install php56-opcache
brew install php71-opcache

# Install Symfony
sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony

# 今のところは3.3のプロジェクトができる
symfony new my_project_name

# 動作チェック
php my_project_name/bin/console server:run

ブラウザで http://localhost:8000/config.php を開いて
All checks passed successfully. Your system is ready to run Symfony applications.
ってなったらOK

Install Laravel(https://laravel.com/docs/5.5)

brew install homebrew/php/composer

composer global require "laravel/installer"

# パス通しとく
export PATH=$PATH:$HOME/.composer/vendor/bin

laravel new my_project_name

# 動作チェック
php my_project_name/artisan serve

ブラウザで http://localhost:8000/config.php を開いてLaravelって表示されていればOK

ざっつおーる

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