创建Laravel项目时出错

时间:2018-08-02 11:15:04

标签: php laravel composer-php

使用laravel new project命令创建项目时出现错误。 项目已创建,但是这样做会输出错误。在结束制作项目后,您将无法使用php artisan serve运行它。

在制作应用程序时输出的日志是:

Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 70 installs, 0 updates, 0 removals
  - Installing doctrine/inflector (v1.3.0): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing dragonmantank/cron-expression (v2.2.0): Loading from cache
  - Installing erusev/parsedown (1.7.1): Loading from cache
  - Installing vlucas/phpdotenv (v2.5.1): Loading from cache
  - Installing symfony/css-selector (v4.1.3): Downloading (100%)
  - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache
  - Installing symfony/polyfill-php72 (v1.8.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.8.0): Loading from cache
  - Installing symfony/var-dumper (v4.1.3): Downloading (100%)
  - Installing symfony/routing (v4.1.3): Downloading (100%)
  - Installing symfony/process (v4.1.3): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.8.0): Loading from cache
  - Installing symfony/http-foundation (v4.1.3): Downloading (100%)
    Failed to download symfony/http-foundation from dist: The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): ZipArchive::extractTo(C:\Users\manager\Desktop\project/vendor/composer/08eb24bd/symfony-http-foundation-7d93e35\Tests\File\Fixtures\directory/.empty): failed to open stream: Permission denied
    Now trying to download from source
  - Installing symfony/http-foundation (v4.1.3): Cloning 7d93e35476 from cache


  [RuntimeException]
  Failed to clone https://github.com/symfony/http-foundation.git via https, ssh protocols, aborting.

  - https://github.com/symfony/http-foundation.git
    fatal: destination path 'C:\Users\manager\Desktop\project\vendor\symfony\http-foundation' already exists and is not an empty directory.

  - git@github.com:symfony/http-foundation.git
    fatal: destination path 'C:\Users\manager\Desktop\project\vendor\symfony\http-foundation' already exists and is not an empty directory.


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

Application ready! Build something amazing.

当您尝试运行该应用程序时,其输出的日志为:

PHP Warning:  require(C:\Users\manager\Desktop\project/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\manager\Desktop\project\artisan on line 18

Warning: require(C:\Users\manager\Desktop\project/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\manager\Desktop\project\artisan on line 18
PHP Fatal error:  require(): Failed opening required 'C:\Users\manager\Desktop\project/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\manager\Desktop\project\artisan on line 18

Fatal error: require(): Failed opening required 'C:\Users\manager\Desktop\project/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\manager\Desktop\project\artisan on line 18

我尝试克隆https://github.com/symfony/http-foundation.git存储库,并且在同一终端上使用git clone https://github.com/symfony/http-foundation.git可以正常工作。

我也试图在互联网上查找错误,但到目前为止没有任何帮助。我想为以后的所有项目解决此问题,特别是针对该项目。

1 个答案:

答案 0 :(得分:0)

php artisan config:cache
composer update