Обновление PHP 5.6 до 7.0 - PullRequest
0 голосов
/ 04 июня 2018

Я вытащил существующий проект Laravel из Git и создал файл .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, которая в какой-то момент была установлена, но закончилась следующим предложением и ошибкой

- 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

Подсветка \ 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

IЯ установил PHP 7.0, но версия еще не изменилась.PHP 7 является обязательной версией.Как мне переключиться?Я использую Laravel на Mac

Как мне решить эту проблему?Мне нужно установить генерировать APP_Key и запустить подачу.

Ответы [ 2 ]

0 голосов
/ 05 июня 2018

После различных попыток решить эту проблему, следующие шаги, которые работали для меня:

brew install brew tap homebrew/dupes

, который показывает «Предупреждение: домашний напиток / ядро ​​мелкий клон».Чтобы решить эту проблему, я запустил

git -C "$(brew --repo homebrew/core)" fetch --unshallow

, затем

brew install brew-php-switcher

. Приведенная выше команда установила зависимости brew-php-switcher, а также версию php 7.2.6.Запуск

vim ~/.bash_profile

для вставки экспорта PATH = / Applications / MAMP / bin / php / php7.2.6 / bin: $ PATH

Проверка версии php с помощью "php -v"

PHP 7.2.6 (cli) (сборка: 5 июня 2018 г. 10:09:45) (NTS) Copyright (c) 1997-2018 PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 ZendТехнологии с Zend OPcache v7.2.6, Copyright (c) 1999-2018, Zend Technologies

PS: я заметил, что когда я проверяю версию, используя ответ, который я получил, был

/usr/local/bin/php 

Я не знаю, почему это так, но на случай, если вы столкнетесь с этим, попробуйте использовать php --version или php -v

0 голосов
/ 04 июня 2018

Вы пробовали использовать brew?

$ brew unlink php56
$ brew install php70

Не забудьте перезапустить apache ...

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...