質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

Q&A

解決済

1回答

2839閲覧

laravelをインストールできない

tidavest

総合スコア595

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

0グッド

0クリップ

投稿2017/09/03 04:29

https://readouble.com/laravel/5.1/ja/installation.html

上記URLの```composer global require "laravel/installer"

というコードを実行するためには、laravelコマンドが端末で実行できるように、~/.composer/vendor/binディレクトリーへ実行PATHを通してください。 上記を実行しないといけないと記載がありますが、これは、どのようにすれば、宜しいでしょうか。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

composerを導入すれば解決します。

https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx
をみて導入してはいかがでしょうか?

ダウンロードして、mvで移動するだけです。簡単です。

投稿2017/09/03 15:00

fagai

総合スコア2158

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tidavest

2017/09/03 21:21

composer.pharをstatできません。そのようなファイル、ディレクトリがありません。となります。
fagai

2017/09/04 07:01

composer.pharはダウンロードしてくるんですよ
tidavest

2017/09/04 07:14

ダウンロードしhomeディレクトリに入っています。これをlocal/binに持ってこないといけないのでしょうか。
fagai

2017/09/04 07:19

それを/usr/local/bin/composerへmvすればOKです。 そうしたらcomposerコマンドが使えるようになります。
tidavest

2017/09/04 07:59

cd /usr/local/binを指定し、このデイレクトリに curl -sS https://getcomposer.org/installer | php とインストールコマンドを打ったのですが、 he installation directory "/usr/local/bin" is not writable というエラーが出ました。 これを解消できませんでしょうか。 ファイルの移動も出来ませんでした。
tidavest

2017/09/04 08:04

binは、既にありました。
fagai

2017/09/04 08:06

sudoコマンドなどを使ってみてください。
fagai

2017/09/04 08:06

それかubuntuだとスーパーユーザーコンソールみたいなのあったような気がするのでそれでも。
fagai

2017/09/04 08:26

?mvコマンドにsudoを付けるだけですよ sudo mv composer.phar /usr/local/bin/composer でいけませんか
tidavest

2017/09/04 08:27

sudoのパスワードは、既に設定してありました。sudoで、実行するもエラーでした。
tidavest

2017/09/04 08:30

まず、binにcomposerをインストールしないといけないようなのですが、出来ませんでした。
fagai

2017/09/04 08:33

すでに設定してありましたというのがよく分かりませんが・・・パスワードをきかれるので自分のパスワードを入力します。 1. ホームディレクトリなどでcurlでcomposer.pharをDLする 2.そのあとそのディレクトリ上でsudo mv composer.phar /usr/local/bin/composerする 以上です。
fagai

2017/09/04 08:34

/usr/loca/bin上で標準ユーザーからcurlができないのは当然です。権限がないのですから。
fagai

2017/09/04 08:39

だからbinに直接curlしないでください
fagai

2017/09/04 08:47 編集

cd ↑自身のホームディレクトリに移動します curl -sS https://getcomposer.org/installer | php ↑curlでcomposer.pharをダウンロードします sudo mv composer.phar /usr/local/bin/composer ↑管理者権限でcomposer.pharを/usr/local/bin/composerへ移動します sudoの際には自分のパスワードを入力する必要があるので入力します。 これでわかりませんか・・・? これでもわからない場合は正直お手上げなので一度linuxの基礎を覚えてください・・・
tidavest

2017/09/04 08:49

root@tida-VirtualBox:~# curl -sS https://getcomposer.org/installer | php All settings correct for using Composer Downloading... Composer (version 1.5.1) successfully installed to: /root/composer.phar Use it: php composer.phar
tidavest

2017/09/04 08:51

root@tida-VirtualBox:~# curl -sS https://getcomposer.org/installer | php All settings correct for using Composer Downloading... Composer (version 1.5.1) successfully installed to: /root/composer.phar Use it: php composer.phar これで、composerをhomeデイレクトリにダウンロード出来ました。 このあと、sudo mv composer.phar /usr/local/bin/composer mv: 'composer.phar' を stat できません: そのようなファイルやディレクトリはありません とエラーが出ます。
fagai

2017/09/04 08:55

ああ、rootにしたのですね。 では mv /root/composer.phar /usr/local/bin/composer でどうでしょうか
fagai

2017/09/04 08:56

ただ、rootで入れてしまうとファイルの所有者が変わってしまうので、合わせる必要があります。 すごく妥協するならchmod 777 /usr/loca/bin/composerを打っておきましょう。
tidavest

2017/09/04 08:57

binにcomoserファイルが見つかりました。ありがとうございます。
tidavest

2017/09/04 08:58

~# mv /root/composer.phar /usr/local/bin/composer mv: '/root/composer.phar' を stat できません: そのようなファイルやディレクトリはありません
tidavest

2017/09/04 08:59

pathを通せませんでした。
fagai

2017/09/04 09:02

いまどうなっているのかよくわからないのですが、 すでにbinにcomposerファイルが存在するのであればそれはやらなくて結構です。 rootを抜けて、一般ユーザーでcomposerコマンドが打てますか?
tidavest

2017/09/04 09:04

# composer update Do not run Composer as root/super user! See https://getcomposer.org/root for details Composer could not find a composer.json file in /root To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section となります。
fagai

2017/09/04 09:07 編集

> rootを抜けて、一般ユーザーでcomposerコマンドが打てますか? rootユーザーを抜けてください
tidavest

2017/09/04 09:07

どのように抜けるのでしょうか。
fagai

2017/09/04 09:08

exitやGUI環境ならコンソールを閉じてください
tidavest

2017/09/04 09:21

root@tida-VirtualBox:~# exist exist: コマンドが見つかりません となります。
fagai

2017/09/04 09:22

exitです
tidavest

2017/09/04 09:23

今まで、cd sampleで、移動できていたのに、root@tida-VirtualBox:~# sudo cd sample sudo: cd: コマンドが見つかりません となります。
fagai

2017/09/04 09:24

sudoをつけているからでは・・・
tidavest

2017/09/04 09:26

oot@tida-VirtualBox:~# exit exit root@tida-VirtualBox:~# cd sample bash: cd: sample: そのようなファイルやディレクトリはありません
tidavest

2017/09/04 09:26

exit後も、rootが頭についています。
fagai

2017/09/04 09:31 編集

まだrootを抜け出せていませんよ、#と付く限りrootです。 UbuntuはCUI環境ですか?GUI環境ですか? 正直なところ、現状の知識ではCUI環境を選んでるとは思えないのでGUIと予想すれとコンソールを閉じて、再度立ち上げなおしてください。
tidavest

2017/09/04 09:30

それを行いましたが、rootがはずれません。
fagai

2017/09/04 09:31

普通のコンソールを利用していますか?
fagai

2017/09/04 09:33

無理でしたら再起動したほうが早いかと思われます
tidavest

2017/09/04 09:35

root抜けられました。
tidavest

2017/09/04 09:36

$ composer update Cannot create cache directory /home/tida/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/tida/.composer/cache/files/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/tida/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - phpunit/phpunit 6.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.9 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.6 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.13 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.12 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.11 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.10 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 6.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.7 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.6 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.21 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.20 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.19 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.18 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.17 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.16 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.15 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.14 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.13 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.12 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.11 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.10 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 5.7.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - Installation request for phpunit/phpunit ^5.7 || ^6.0 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9, 6.0.0, 6.0.1, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.3.0]. To enable extensions, verify that they are enabled in your .ini files: - /etc/php/7.0/cli/php.ini - /etc/php/7.0/cli/conf.d/10-opcache.ini - /etc/php/7.0/cli/conf.d/10-pdo.ini - /etc/php/7.0/cli/conf.d/20-calendar.ini - /etc/php/7.0/cli/conf.d/20-ctype.ini - /etc/php/7.0/cli/conf.d/20-exif.ini - /etc/php/7.0/cli/conf.d/20-fileinfo.ini - /etc/php/7.0/cli/conf.d/20-ftp.ini - /etc/php/7.0/cli/conf.d/20-gettext.ini - /etc/php/7.0/cli/conf.d/20-iconv.ini - /etc/php/7.0/cli/conf.d/20-json.ini - /etc/php/7.0/cli/conf.d/20-phar.ini - /etc/php/7.0/cli/conf.d/20-posix.ini - /etc/php/7.0/cli/conf.d/20-readline.ini - /etc/php/7.0/cli/conf.d/20-shmop.ini - /etc/php/7.0/cli/conf.d/20-sockets.ini - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini - /etc/php/7.0/cli/conf.d/20-sysvsem.ini - /etc/php/7.0/cli/conf.d/20-sysvshm.ini - /etc/php/7.0/cli/conf.d/20-tokenizer.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
tidavest

2017/09/04 09:37

composer updateできているのでしょうか。
fagai

2017/09/04 09:44 編集

せめて読む努力をしましょう。エラーなのか、エラーじゃないのかくらいは読んでみればわかります。 phpのdomエクステンションが入っていませんので入れる必要があります。ただし、domという名前でエクステンションは存在していないのでxml拡張を入れる必要があります。 どうやってphpを入れたかこちらではわかりませんので、やってみてください。 あとcomposer updateじゃなくてcomposerだけで大丈夫です。
tidavest

2017/09/04 09:44

今新たに、composerを入れたところのエラーです。
fagai

2017/09/04 09:45

なぜcomposerを再度入れようとしているのですか?
fagai

2017/09/04 09:51 編集

composerを入れたことには成功していますが、拡張が足りないので動きません。 ↑18:36の状態 なので再度composerを入れる必要はありません。
tidavest

2017/09/04 09:53

~$ sudo yum install php-xml 有効なリポジトリーがありません。 「yum repolist all」を実行し、所持するリポジトリーを参照してください。 「yum-config-manager --enable <repo>」でリポジトリーを有効にできます。 tida@tida-VirtualBox:~$ yum-config-manager --enable <repo> bash: 予期しないトークン `newline' 周辺に構文エラーがあります tida@tida-VirtualBox:~$ yum repolist all repolist: 0 tida@tida-VirtualBox:~$ yum-config-manager --enable <repo> bash: 予期しないトークン `newline' 周辺に構文エラーがあります tida@tida-VirtualBox:~$
tidavest

2017/09/04 09:53

~$ sudo yum install php-xml これが、domを入れるコマンドだと思うのですが、 出来ませんでした。
fagai

2017/09/04 09:54

利用しているのubuntuって言っていませんでした?
tidavest

2017/09/04 10:13

$ composer update Cannot create cache directory /home/tida/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/tida/.composer/cache/files/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/tida/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache > php artisan clear-compiled PHP Warning: require(/home/tida/sample/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/tida/sample/bootstrap/autoload.php on line 17 PHP Fatal error: require(): Failed opening required '/home/tida/sample/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/tida/sample/bootstrap/autoload.php on line 17 Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255
tidavest

2017/09/04 10:13

次は、domの文面は出てきませんでした。
tidavest

2017/09/04 10:14

ubuntnu domで、検索したところ、Node.jsをインストールというものが出来てきたので、そちらをインストールしました。
fagai

2017/09/04 10:20

なぜphpのdom拡張の話なのにnode.jsをインストールすることになるのか、私には全く理解できません。
fagai

2017/09/04 10:23

Cannot create cache directory /home/tida/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache の件は一度/home/tida/.composer/ディレクトリを消したほうが良いでしょう。通常のオペレーションで書き込みができないという自体に陥ったことは一度も無いので
tidavest

2017/09/04 10:23

~$ sudo yum install php-xml こちらのコマンドをでは、ないということでしょうか。
fagai

2017/09/04 10:25

yumはCentOSなどで利用するパッケージマネージャーです。見た記事にCentOSと書かれていませんでしたか?
tidavest

2017/09/04 10:27

ubuntnuでは、どのように入力するのでしょうか。
fagai

2017/09/04 10:30

それは調べてもわからなかったことですか? php-xml php7 ubuntu とか検索したらどうでしょうか
tidavest

2017/09/04 10:47

php-xml をインストールできましたが、composer updateでは、同様のエラーです。
fagai

2017/09/04 10:52 編集

1.19:23の件を解消しても同様のエラーでしょうか? そうなるとそもそもsampleプロジェクトのパーミッションがおかしいかもしれません。 2./home/tida/sample/に移動してls -alコマンドを打ってみてください 3.パーミッションや所有者がおかしい場合は、再度laravel newで作り直したほうが良いです。
tidavest

2017/09/04 10:53

合計 1984 drwxr-xr-x 25 tida tida 4096 9月 4 19:06 . drwxr-xr-x 4 root root 4096 8月 30 17:30 .. -rw------- 1 tida tida 3536 9月 4 19:06 .ICEauthority -rw------- 1 tida tida 60 9月 4 19:06 .Xauthority -rw------- 1 tida tida 2804 9月 4 16:20 .bash_history -rw-r--r-- 1 tida tida 220 8月 30 17:30 .bash_logout -rw-r--r-- 1 tida tida 3637 8月 30 17:30 .bashrc drwx------ 20 tida tida 4096 9月 3 13:06 .cache drwxr-xr-x 4 root root 4096 9月 3 18:47 .composer drwx------ 20 tida tida 4096 9月 3 18:24 .config drwx------ 3 tida tida 4096 8月 30 17:31 .dbus drwx------ 3 tida tida 4096 9月 4 19:07 .gconf drwx------ 3 tida tida 4096 9月 4 19:06 .gnupg drwxrwxr-x 2 tida tida 4096 9月 1 03:07 .gstreamer-0.10 drwxr-xr-x 3 tida tida 4096 8月 30 17:31 .local drwx------ 2 tida tida 4096 9月 4 19:48 .mozc drwx------ 4 tida tida 4096 8月 30 17:32 .mozilla drwx------ 2 tida tida 4096 9月 1 08:59 .presage -rw-r--r-- 1 tida tida 675 8月 30 17:30 .profile drwxr-xr-x 2 tida tida 4096 9月 4 18:48 .rpmdb -rw-r--r-- 1 tida tida 0 9月 1 05:48 .sudo_as_admin_successful drwxrwxr-x 7 tida tida 4096 9月 3 09:28 .vagrant.d -rw-r----- 1 tida tida 5 9月 4 19:06 .vboxclient-clipboard.pid -rw-r----- 1 tida tida 5 9月 4 19:06 .vboxclient-display.pid -rw-r----- 1 tida tida 5 9月 4 19:06 .vboxclient-draganddrop.pid -rw------- 1 tida tida 531 9月 4 19:06 .xsession-errors -rw------- 1 tida tida 531 9月 4 19:03 .xsession-errors.old drwxrwxr-x 9 tida tida 4096 9月 3 07:25 Homestead -rw-rw-r-- 1 tida tida 809 9月 3 19:03 composer.json -rw-r--r-- 1 tida tida 8980 8月 30 17:30 examples.desktop -rwxr-xr-x 1 root root 1856985 9月 4 07:11 home -rw------- 1 tida tida 1766 9月 3 17:53 key -rw-r--r-- 1 tida tida 402 9月 3 17:53 key.pub drwxrwxr-x 12 tida tida 4096 9月 3 19:38 sample drwxr-xr-x 2 tida tida 4096 9月 1 05:49 ダウンロード drwxr-xr-x 2 tida tida 4096 8月 30 17:31 テンプレート drwxr-xr-x 2 tida tida 4096 9月 1 03:11 デスクトップ drwxr-xr-x 2 tida tida 4096 8月 30 17:31 ドキュメント drwxr-xr-x 2 tida tida 4096 8月 30 17:31 ビデオ drwxr-xr-x 2 tida tida 4096 9月 3 18:39 ピクチャ drwxr-xr-x 2 tida tida 4096 8月 30 17:31 ミュージック drwxr-xr-x 2 tida tida 4096 8月 30 17:31 公開
tidavest

2017/09/04 10:53

とでました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問