简体   繁体   English

无法使用 Composer 设置 Laravel 项目

[英]Can't Setup Laravel Project Using Composer

I try to setup a laravel project using composer with this command我尝试使用 composer 和这个命令设置一个 Laravel 项目

composer create-project laravel/laravel blog "5.1.*"

But i got following error:但我收到以下错误:

Script php artisan clear-compiled handling the pre-update-cmd event returned with an error




[RuntimeException]                                                           
  Error Output: PHP Warning:  require(/home/iwan/blog/bootstrap/../vendor/aut  
  oload.php): failed to open stream: No such file or directory in /home/iwan/  
  blog/bootstrap/autoload.php on line 17                                       
  PHP Fatal error:  require(): Failed opening required '/home/iwan/blog/boots  
  trap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pea  
  r') in /home/iwan/blog/bootstrap/autoload.php on line 17  

Does anybody know how to fix this ?有人知道如何解决这个问题吗?

Thank you谢谢

Actually, the project is created but the dependencies are not installed so open your terminal/command prompt and run following commands:实际上,项目已创建但未安装依赖项,因此打开终端/命令提示符并运行以下命令:

cd blog
composer install

Also, if you want then, you may install the Laravel installer so you can create a new project using something like the following:此外,如果您愿意,您可以安装Laravel installer以便您可以使用以下内容创建一个新项目:

laravel new Blog

This is a little bit faster.这要快一点。 So to install the installer you need to run the following command from the command prompt/terminal:因此,要安装安装installer您需要从命令提示符/终端运行以下命令:

composer global require "laravel/installer=~1.1"

Once you install the installer you may then run laravel new someproject from the terminel to create a new project with all the dependencies ( According to Documentation ).安装安装installer您可以从终端运行laravel new someproject以创建一个包含所有依赖项的新项目(根据文档)。


Note: Check this and this as well if needed.注意:如果需要,也检查这个这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM