1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHP Warning: require(/path/to/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /path/to/vendor/composer/autoload_real.php on line 66となったときの対応方法

Last updated at Posted at 2019-05-06
  • 環境
    • macOS Mojave バージョン10.14.4
    • PHP 7.3.1 (cli)
    • Composer version 1.8.0

事象 : Laravelのバージョンを確認しようとしたら怒られた。

$ php artisan -V
PHP Warning:  require(/path/to/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /path/to/vendor/composer/autoload_real.php on line 66

Warning: require(/path/to/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /path/to/vendor/composer/autoload_real.php on line 66
PHP Fatal error:  require(): Failed opening required '/path/to/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /path/to/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/path/to/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /path/to/vendor/composer/autoload_real.php on line 66

原因 : 必要なファイルがvenderディレクトリにないから

symfony - laravel on cpanel raise error for autoload_real.php on line 66 - Stack Overflow

対応 : composer updateする

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 77 installs, 4 updates, 0 removals
... 省略 ...
  - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
... 省略 ...
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.

# 治りました。
$ php artisan -V
Laravel Framework 5.7.28

この間は問題なかったのに・・・なぜ?

ちょっと前の結果
$ php artisan -V
Laravel Framework 5.8.14

何かが更新でもされたのだろうか?それともなにかやったのを忘却しているのだろうか?

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?