Having problems installing Laravel? You need to update Composer.json file

Source: Internet
Author: User
Tags autoload pear script php

<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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.