- ベストアンサー
centos7 環境変数 Laravel
[vagrant@localhost ~]$ echo export PATH=$HOME/.composer/vendor/bin:$PATH >> ,bash_profile [vagrant@localhost ~]$ source ~/.bash_profile [vagrant@localhost ~]$ laravel -bash: laravel: command not found としてもコマンドが認識されません。なぜでしょうか?
- みんなの回答 (2)
- 専門家の回答
お礼
ご回答ありがとうございます。 .composer/vendor/laravel(/) .composer/vendor/bin(/) をすべて試しましたが駄目でした。どういった原因が考えられるでしょうか? [vagrant@localhost ~]$ vi .bashrc [vagrant@localhost ~]$ source .bashrc [vagrant@localhost ~]$ laravel -bash: laravel: command not found [vagrant@localhost ~]$ echo $PATH /home/vagrant/.composer/vendor/laravel:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.composer/vendor ////////////////////////////// [vagrant@localhost ~]$ vi .bashrc [vagrant@localhost ~]$ source .bashrc [vagrant@localhost ~]$ laravel -bash: laravel: command not found [vagrant@localhost ~]$ echo $PATH /home/vagrant/.composer/vendor/laravel/:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.composer/vendor ////////////////////////////// [vagrant@localhost ~]$ vi .bashrc [vagrant@localhost ~]$ source .bashrc [vagrant@localhost ~]$ laravel -bash: laravel: command not found [vagrant@localhost ~]$ echo $PATH /home/vagrant/.composer/vendor/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.composer/vendor ////////////////////////////// [vagrant@localhost ~]$ vi .bashrc [vagrant@localhost ~]$ source .bashrc [vagrant@localhost ~]$ laravel -bash: laravel: command not found [vagrant@localhost ~]$ echo $PATH /home/vagrant/.composer/vendor/bin/:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.local/bin:/home/vagrant/bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/.composer/vendor
補足
またコマンドとして実行できるファイルはコマンド名が緑色で表示されるようですが(artisanはエラーが出ますが、一応実行できるので、、)、vendor/bin以下にもvendor/laravel,vendor/laravel/laravel以下にもlaravelという文字が緑で表示されているものはないのですが、そもそもインストールの時点でなにかおかしなことをやったのでしょうか? [vagrant@localhost laravel]$ ls app bootstrap config package.json public resources server.php tests artisan composer.json database phpunit.xml README.md routes storage webpack.mix.js [vagrant@localhost laravel]$ ./artisan PHP Warning: require(/home/vagrant/.composer/vendor/laravel/laravel/vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/.composer/vendor/laravel/laravel/artisan on line 18 PHP Fatal error: require(): Failed opening required '/home/vagrant/.composer/vendor/laravel/laravel/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/vagrant/.composer/vendor/laravel/laravel/artisan on line 18