【发布时间】:2020-06-28 20:05:04
【问题描述】:
解决方案:我已将我的操作系统更新到支持最新 PHP 的最新版本。
我有一个新的 laravel 项目
当我运行php artisan serve
它显示:
MacBook-Pro% php artisan serve
Warning: require(/Users/username/Desktop/code/argon/vendor/autoload.php): failed to open stream: No such file or directory in /Users/username/Desktop/code/argon/artisan on line 18
Fatal error: require(): Failed opening required '/Users/username/Desktop/code/argon/vendor/autoload.php' (include_path='.:') in /Users/username/Desktop/code/argon/artisan on line 18
composer update 显示
MacBook-Pro% composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.2.5 but your PHP version (7.1.23) does not satisfy that requirement.
Problem 2
- laravel/tinker v2.2.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/tinker v2.1.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/tinker v2.0.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/tinker 2.x-dev requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- Installation request for laravel/tinker ^2.0 -> satisfiable by laravel/tinker[2.x-dev, v2.0.0, v2.1.0, v2.2.0].
MacBook-Pro% php -v
PHP 7.1.23 (cli) (built: Nov 7 2018 18:20:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
还有
MacBook-Pro% brew unlink php@7.1
Error: No such keg: /usr/local/Cellar/php@7.1
MacBook-Pro% brew unlink php71
Error: No such keg: /usr/local/Cellar/php71
还有
MacBook-Pro% which php
/usr/bin/php
任何想法如何删除 php 7.1.23 ?
【问题讨论】:
-
你必须有一个非常旧的 macOS 版本。您不能删除 PHP 的系统版本。安装一个较新的。
-
这是 MacOS Mojave v10.14.3
标签: php laravel macos composer-php