Subscribed unsubscribe Subscribe Subscribe

Laravel5 × PHP7

Laravel5の依存モジュール

PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension

Laravelのインストール

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer global require "laravel/installer=~1.1"
vi ~/.bash_profile
PATH="$HOME/.composer/vendor/bin:${PATH}"

Homesteadを使う場合の環境構築手順

vagrant -v → Vagrant 1.7.4
VirtualBox → 5.0.6
git clone -b php-7 https://github.com/laravel/homestead.git Homestead
cd Homestead
bash init.sh
mkdir ~/Code && cd ~/Code/ && laravel new Laravel && cd -

vi ~/.homestead/Homestead.yaml
folders:
    - map: ~/Code
      to: /home/vagrant/Code
      type: "nfs" ←これを追加

vagrant up
sudo vi /etc/hosts
192.168.10.10  homestead.app
http://homestead.app

Homestead使わない場合の環境構築手順

brew tap homebrew/php
brew search /php7/
brew install php70 php70-kafka php70-mcrypt php70-pdo-dblib php70-yaml php70-gmp php70-libsodium php70-memcached php70-opcache php70-pdo-pgsql php70-snmp php70-intl php70-lzf php70-msgpack php70-pcntl php70-pspell php70-tidy
brew install --HEAD homebrew/php/php70-redis

laravel new {$アプリケーション名}
php artisan serve
http://localhost:8000/

※php70-mustacheはインストールしたければする