@kuchen

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

laravel 環境構築

解決したいこと

laravelの環境構築をしようとしています。

chromeでhttp://localhost/testweb/public/を入力した所、3つのエラーが出てきました。解決したいです。

Warning: require(C:\xampp\htdocs\testweb\public/../vendor/autoload.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\testweb\public\index.php on line 14

Fatal error: Uncaught Error: Failed opening required 'C:\xampp\htdocs\testweb\public/../vendor/autoload.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\testweb\public\index.php on line 14

Error: Failed opening required 'C:\xampp\htdocs\testweb\public/../vendor/autoload.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\testweb\public\index.php on line 14

0 likes

2Answer

何をやったのか書いてないのでエスパー回答になりますが、composer install を実行していないことが原因と思われます。
余談ですが記述内容に色々おかしな点があるので、新しめの教本を使用して学習した方が良いです。

0Like

コマンドプロンプトでcomposer installを実行しました。

C:\Users\fykoh>composer install
Composer could not detect the root package (fyot/fykoh) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files

お察しの通り初学者です。

0Like

Comments

  1. 実行ディレクトリが間違っています。
    C:\xampp\htdocs\testweb
    でコマンドを叩く必要があります。
    なお、先にも書きましたが、教本を再検討してください。
    手元にある教本は公式のインストール方法を使用していないと思われます。
    https://laravel.com/docs/12.x

  2. @kuchen

    Questioner

    解決しました。

    現時点では公式サイトを理解する事が難しいため、動画やブログを参考にしています。
    とはいえ、正式な手順は重要ですので、徐々に覚えていこうと思います。

    ありがとうございます。

Your answer might help someone💌