環境
MacOSX High Sierra 10.13.3
php: PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
ターミナル: iterm2 Build 3.1.5
やりたい事
laravel5.4
でvalet
を使いたい。
やった事
動画サイトlaracastのLaravel 5.4 From ScratchのEPISODE3 Laravel Valet is Your Best Friend
にそってvalet install
を叩いてみました。
実行結果
以下のエラーが出力されます。
bash
1In Brew.php line 179: 2 3 Unable to determine linked PHP.
教えていただきたいこと
エラーの回避方法と、なぜそのようなエラーが出るかについて教えていただきたいです。
やった事の詳細 ~ 追記(2018.4.8 7:30)
ターミナル(iterm2)でやった事を詳しく書いていきます。
~/development/laravel/laracast
はbashプロンプトです。
- 作業ディレクトリの確認
~/development/laravel/laracast pwd /Users/taro/development/laravel/laracast
- phpのバージョンの確認
~/development/laravel/laracast php -v PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
- composerのインストール
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
composer.pharがインストールされたことが確認できた
- composer.pharを名前を変えて移動
~/development/laravel/laracast mv composer.phar /usr/local/bin/composer
- laravel installerのインストール
~/development/laravel/laracast composer global require "laravel/installer" Changed current directory to /Users/taro/.composer Using version ^2.0 for laravel/installer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files
- パスの確認
~/development/laravel/laracast echo $PATH /Users/taro/.composer/vendor/bin:/Users/taro/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/taro/bin:.
~/.composer/vendor/binにパスが通っている
- laravelが実行できるかの確認
~/development/laravel/laracast laravel -V Laravel Installer 2.0.1
laravelは実行できるけど、
~/development/laravel/laracast laravel new myBlog ~/development/laravel/laracast cd myBlog ~/development/laravel/laracast/myBlog php artisan -V Laravel Framework 5.6.15
laravel5.6がインストールされてしまう
laravel new
でバージョンを指定する仕方が分からないのでlaravel new
は一旦あきらめた
- composerを使ったlaravel5.4のインストール
~/development/laravel/laracast cd .. ~/development/laravel/laracast composer create-project --prefer-dist laravel/laravel myBlog2 "5.4.*" ~/development/laravel/laracast cd myBlog2 ~/development/laravel/laracast/myBlog2 php artisan -V Laravel Framework 5.4.36
laravel5.4のインストールに成功
- laravelのデフォルトページの表示の確認
~/development/laravel/laracast/myBlog2 php artisan serve Laravel development server started: <http://127.0.0.1:8000>
ブラウザでhttp://127.0.0.1:8000にアクセスするとデフォルトのページが表示された
- Homebrewのインストール
https://brew.sh/
に書いてある一行をiterm2で実行
~/development/laravel/laracast/myBlog2 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -e:161: warning: Insecure world writable dir /Users/taro/development/laravel in PATH, mode 040777 ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew (中略) ==> Next steps: - Run `brew help` to get started - Further documentation: https://docs.brew.sh
brewがインストールされた
- brewを使ってphp7.1をインストール(?)
~/development/laravel/laracast/myBlog2 brew install homebrew/php/php71 Warning: Use php@7.1 instead of deprecated homebrew/php/php71 Warning: php@7.1 7.1.16 is already installed and up-to-date To reinstall 7.1.16, run `brew reinstall php@7.1`
homerew/php/php71
が推奨されていなくて代わりのphp@7.1
が最新の状態でインストールされてる模様
- valetのインストール
~/development/laravel/laracast/myBlog2 composer global require laravel/valet Changed current directory to /Users/taro/.composer Using version ^2.0 for laravel/valet ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files ~/development/laravel/laracast/myBlog2 valet -V Laravel Valet 2.0.10
valetのインストールも出来た様子
- valet install
~/development/laravel/laracast/myBlog2 valet install Stopping nginx... Installing nginx configuration... Installing nginx directory... Updating PHP configuration... In Brew.php line 179: Unable to determine linked PHP. install
とここで本題のエラーが出る
疑問
valet new
でlaravelのバージョンを指定する方法はありますか?
valet install
でエラーが発生することへの対処法はありますか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。