【发布时间】:2018-11-14 00:42:39
【问题描述】:
我从 Git 中提取了一个现有的 Laravel 项目并创建了缺少的 .env 文件。当我运行作曲家安装时,错误消息
Your requirements could not be resolved to an installable set of packages.
Problem 1
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.36 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.5 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.3 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.28 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.2 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
- illuminate/support v5.6.27 requires php >=7.0 -> your PHP version (5.6.32) does not satisfy that requirement.
之后我安装 PHP 7.0 版本。我尝试使用 PHP 的命令检查更改,但它仍然指示 PHP 5.6.27。 我运行了 composer install 安装到某个点但以以下建议和错误结束
- Installing phpunit/phpunit (6.5.8): Downloading (100%)
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
symfony/console suggests installing symfony/filesystem ()
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
symfony/translation suggests installing symfony/config ()
symfony/translation suggests installing symfony/yaml ()
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.5).)
laravel/framework suggests installing ext-pcntl (Required to use all features of the queue worker.)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use Flysystem caching (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (~3.3).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (~1.0).)
intervention/image suggests installing ext-imagick (to use Imagick based image processing.)
intervention/image suggests installing intervention/imagecache (Caching extension for the Intervention Image library)
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
Parse error: syntax error, unexpected '?' in /Applications/MAMP/htdocs/folder/projectname/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
我已安装 PHP 7.0,但版本尚未更改。 PHP 7 是必需的版本。我该如何切换?我在 mac 上使用 Laravel
我该如何解决这个问题?我需要设置生成 APP_Key 并启动服务。
【问题讨论】:
-
你是如何安装新的 php 的?用过家酿?运行此命令可能会有所帮助
export PATH=/usr/local/php5/bin:$PATH如此处建议:medium.com/zenchef-tech-and-product/… 或检查php-osx.liip.ch -
使用 Homebrew 可以为您节省一些时间:stackoverflow.com/a/41872735/5704410
-
我运行了这个命令 curl -s php-osx.liip.ch/install.sh | bash -s 7.0
-
我们可以看看那行吗? :)