<pre class="markdown-doc">
~ ~ ~ URL
Reprinted from Https://9iphp.com/web/laravel/laravel-install-fail-update-composer.html
~~~
When installing Laravel with the latest version of Composer, you may experience the following problems and the installation fails:
~ ~ Shell
$ php composer.phar create-project--prefer-dist laravel/laravel Blog
Installing Laravel/laravel (v5.2.15)
-Installing Laravel/laravel (v5.2.15)
Loading from Cache
Created project in Blog
> php-r "Copy ('. Env.example ', '. Env ');"
> PHP artisan clear-compiled
php warning:require (/home/vagrant/laraveltest/blog/bootstrap/. /vendor/autoload.php): Failed to open stream:no such file or directory In/home/vagrant/laraveltest/blog/bootstrap/autol oad.php on line +
PHP Fatal error:require (): Failed opening required '/home/vagrant/laraveltest/blog/bootstrap/. /vendor/autoload.php ' (include_path= '.:/ Usr/share/pear:/usr/share/php ') in/home/vagrant/laraveltest/blog/bootstrap/autoload.php on line +
Script php Artisan clear-compiled Handling the Pre-update-cmd event returned with an error
[RuntimeException]
Error output:php Warning:require (/home/vagrant/laraveltest/blog/bootstrap/. /vendor/autoload.php): Failed to open stream:no such file or directory IN/HOME/VAGRANT/LARAVELTEST/BL
og/bootstrap/autoload.php on line 17
PHP Fatal Error:require (): Failed opening required '/home/vagrant/laraveltest/blog/bootstrap/. /vendor/autoload.php ' (include_path= '.:/ usr/share/pear:/usr/share/php ') in/home/vagr
ant/laraveltest/blog/bootstrap/autoload.php on line 17
Create-project [-s|--stability stability] [--prefer-source] [--prefer-dist] [--repository repository] [-- Repository-url Repository-url] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [-- No-progress] [--keep-vcs] [--no-install] [--IGNORE-PLATFORM-REQS] [--] [<package>] [<directory>] [< Version>]
~~~
This is because Composer recently updated the way Pre-update-command works, which makes the Laravel installation fail.
@Jordi Boggiano is given for the following reasons:
This is due to the absence of the Composer.lock file, so the initial install command is replaced by the update operation because it triggers the pre-update-cmd, which is the trigger pre-install-cmd.
Fortunately, fixing the problem is very simple, just move the PHP artisan clear-compiled to Post-update-command:
! Picture (https://static.9iphp.com/wp-content/uploads/2016/03/laravel-composer-change.png)
</pre>
Having problems installing Laravel? You need to update Composer.json file