php artisan服务--抛出错误

php artisan服务--抛出错误,php,laravel,laravel-artisan,Php,Laravel,Laravel Artisan,所以我今天才开始学习拉威尔,安装了Composer和Laravel 我使用以下方法创建了一个新应用程序:- laravel new application 在我的文件夹中:- /Library/WebServer/Documents/ 但是,当我尝试跑步时:- php artisan serve 我得到这个错误:- Warning: require(/Library/WebServer/Documents/application/bootstrap/../vendor/autoload.p

所以我今天才开始学习拉威尔,安装了ComposerLaravel

我使用以下方法创建了一个新应用程序:-

laravel new application
在我的文件夹中:-

/Library/WebServer/Documents/
但是,当我尝试跑步时:-

php artisan serve
我得到这个错误:-

Warning: require(/Library/WebServer/Documents/application/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Library/WebServer/Documents/application/bootstrap/autoload.php on line 17

Fatal error: require(): Failed opening required '/Library/WebServer/Documents/application/bootstrap/../vendor/autoload.php' (include_path='.:') in /Library/WebServer/Documents/application/bootstrap/autoload.php on line 17
我已经尝试更新我的作曲器,但没有成功。 我做错了什么

编辑

运行composer安装提供了以下功能:-

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php >=5.6.4 but your PHP version (5.5.34) does not satisfy that requirement.
  Problem 2
    - Installation request for laravel/framework v5.4.24 -> satisfiable by laravel/framework[v5.4.24].
    - laravel/framework v5.4.24 requires php >=5.6.4 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 3
    - Installation request for phpunit/php-code-coverage 4.0.8 -> satisfiable by phpunit/php-code-coverage[4.0.8].
    - phpunit/php-code-coverage 4.0.8 requires php ^5.6 || ^7.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 4
    - Installation request for phpunit/phpunit 5.7.20 -> satisfiable by phpunit/phpunit[5.7.20].
    - phpunit/phpunit 5.7.20 requires php ^5.6 || ^7.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 5
    - Installation request for phpunit/phpunit-mock-objects 3.4.3 -> satisfiable by phpunit/phpunit-mock-objects[3.4.3].
    - phpunit/phpunit-mock-objects 3.4.3 requires php ^5.6 || ^7.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 6
    - Installation request for sebastian/code-unit-reverse-lookup 1.0.1 -> satisfiable by sebastian/code-unit-reverse-lookup[1.0.1].
    - sebastian/code-unit-reverse-lookup 1.0.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 7
    - Installation request for sebastian/environment 2.0.0 -> satisfiable by sebastian/environment[2.0.0].
    - sebastian/environment 2.0.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 8
    - Installation request for sebastian/object-enumerator 2.0.1 -> satisfiable by sebastian/object-enumerator[2.0.1].
    - sebastian/object-enumerator 2.0.1 requires php >=5.6 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 9
    - Installation request for sebastian/resource-operations 1.0.0 -> satisfiable by sebastian/resource-operations[1.0.0].
    - sebastian/resource-operations 1.0.0 requires php >=5.6.0 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 10
    - Installation request for sebastian/version 2.0.1 -> satisfiable by sebastian/version[2.0.1].
    - sebastian/version 2.0.1 requires php >=5.6 -> your PHP version (5.5.34) does not satisfy that requirement.
  Problem 11
    - laravel/framework v5.4.24 requires php >=5.6.4 -> your PHP version (5.5.34) does not satisfy that requirement.
    - laravel/tinker v1.0.1 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.4.24].
    - Installation request for laravel/tinker v1.0.1 -> satisfiable by laravel/tinker[v1.0.1].
注意:您使用的是需要PHP5.6(最低要求)的Laravel5.4,请将php更新为5.6或使用Laravel5.2,这就是原因 使用此命令安装laravel 5.2

转到命令提示符(在Windows中)

将路径设置为www/{ur project}

对我来说:www/laravel5

然后键入以下命令:composer install

它将自动在供应商中安装所有依赖项/

注意:您使用的是需要PHP5.6(最低要求)的Laravel5.4,请将php更新为5.6或使用Laravel5.2,这就是原因 使用此命令安装laravel 5.2

转到命令提示符(在Windows中)

将路径设置为www/{ur project}

对我来说:www/laravel5

然后键入以下命令:composer install


它将自动安装供应商中的所有依赖项

您必须使用
composer install安装项目的供应商依赖项

# go to the app root folder
cd /Library/WebServer/Documents/application/
# install vendor dependecies
composer install
编辑 编辑问题后,错误消息会清楚地表明您的旧php版本无法运行新的laravel应用程序。您有两个选择:

将您的php升级到PHP5.6.25(最好是php7)

降级你的应用程序(至laravel 5.2.*),下面的脚本将删除它并安装一个新的

# go to the app root folder
cd /Library/WebServer/Documents/
rm -rf application
# install vendor dependecies
composer create-project --prefer-dist laravel/laravel application 5.2.*

您必须使用
composer install
安装项目的供应商依赖项:

# go to the app root folder
cd /Library/WebServer/Documents/application/
# install vendor dependecies
composer install
编辑 编辑问题后,错误消息会清楚地表明您的旧php版本无法运行新的laravel应用程序。您有两个选项:

将您的php升级到PHP5.6.25(最好是php7)

降级你的应用程序(至laravel 5.2.*),下面的脚本将删除它并安装一个新的

# go to the app root folder
cd /Library/WebServer/Documents/
rm -rf application
# install vendor dependecies
composer create-project --prefer-dist laravel/laravel application 5.2.*

我使用的是Mac而不是windows。因此,在Mac中,将目录更改为您的项目路由,我认为缺少一些依赖项。我使用的是Mac而不是windows。因此,在Mac中,将目录更改为您的项目路由,我认为缺少一些依赖项。我正在尝试安装php7,但每次在我完成安装并运行
php-v
。它仍然存在l显示旧的verison。@xanderpower,php7已安装,您必须更正它的路径。请看这里,。或者如果您想跳过此操作,请尝试卸载两个php版本并单独安装php7。我正在尝试安装php7,但每次安装并运行
php-v
。它仍然显示旧的verison。@xanderpower,php7已安装,您必须更正它的路径。请看这里。或者,如果您想跳过此操作,请尝试卸载这两个php版本并单独安装php7。