Issue
Older versions of PHP installed locally can cause errors with Acquia Developer Studio CLI:
Dependency resolution completed in 0.001 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- Installation request for doctrine/lexer 1.1.0 -> satisfiable by doctrine/lexer[1.1.0].
Resolution
We recommend updating your local PHP version to the latest PHP version available on the Cloud. You can check your local PHP version with the following command:
php -v
Example output:
$ php -v
PHP 7.3.9 (cli) (built: Aug 30 2019 01:42:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.9, Copyright (c) 1999-2018, by Zend Technologies
Update PHP on Mac OS
Update your local PHP version using brew
for Mac OS to PHP 7.2 or 7.3:
brew install php@7.3
Once installed, set the path to the php7 version:
export PATH=/usr/local/php7/bin:$PATH
Update PHP on other operating systems
For other operating systems, such as Windows, see:
https://www.php.net/manual/en/install.php
You may need to restart your terminal after updating the PHP version.