I can't install laravel 6 even my php is 7.2 - laravel

I working on my local computer(server). This is first time to install Laravel 6. By typing this command,
Laravel new project
The said
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.2 but your HHVM version does not satisfy that requirement.
Problem 2
- Installation request for doctrine/lexer 1.2.0 -> satisfiable by doctrine/lexer[1.2.0].
- doctrine/lexer 1.2.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 3
- Installation request for laravel/framework v6.14.0 -> satisfiable by laravel/framework[v6.14.0].
- laravel/framework v6.14.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 4
- Installation request for laravel/tinker v2.2.0 -> satisfiable by laravel/tinker[v2.2.0].
- laravel/tinker v2.2.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 5
- Installation request for monolog/monolog 2.0.2 -> satisfiable by monolog/monolog[2.0.2].
- monolog/monolog 2.0.2 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 6
- Installation request for symfony/css-selector v5.0.4 -> satisfiable by symfony/css-selector[v5.0.4].
- symfony/css-selector v5.0.4 requires php ^7.2.5 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 7
- Installation request for symfony/mime v5.0.4 -> satisfiable by symfony/mime[v5.0.4].
- symfony/mime v5.0.4 requires php ^7.2.5 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 8
- Installation request for symfony/service-contracts v2.0.1 -> satisfiable by symfony/service-contracts[v2.0.1].
- symfony/service-contracts v2.0.1 requires php ^7.2.5 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 9
- Installation request for symfony/translation-contracts v2.0.1 -> satisfiable by symfony/translation-contracts[v2.0.1].
- symfony/translation-contracts v2.0.1 requires php ^7.2.5 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 10
- Installation request for phpdocumentor/reflection-docblock 5.0.0 -> satisfiable by phpdocumentor/reflection-docblock[5.0.0].
- phpdocumentor/reflection-docblock 5.0.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 11
- Installation request for phpunit/php-code-coverage 7.0.10 -> satisfiable by phpunit/php-code-coverage[7.0.10].
- phpunit/php-code-coverage 7.0.10 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 12
- Installation request for phpunit/phpunit 8.5.2 -> satisfiable by phpunit/phpunit[8.5.2].
- phpunit/phpunit 8.5.2 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 13
- Installation request for sebastian/global-state 3.0.0 -> satisfiable by sebastian/global-state[3.0.0].
- sebastian/global-state 3.0.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 14
- Installation request for sebastian/type 1.1.3 -> satisfiable by sebastian/type[1.1.3].
- sebastian/type 1.1.3 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
Problem 15
- doctrine/lexer 1.2.0 requires php ^7.2 -> your PHP version (7.1.26) does not satisfy that requirement.
- egulias/email-validator 2.1.15 requires doctrine/lexer ^1.0.1 -> satisfiable by doctrine/lexer[1.2.0].
- Installation request for egulias/email-validator 2.1.15 -> satisfiable by egulias/email-validator[2.1.15].
I am using wamp server
My composer version is
CLI version
How can I fix this? thank you in advance!

It seems like your command line is using a different version of PHP (it seems HHVM).
Try type
where php
in a command prompt and check if the given path is the same inside the WAMP installation folder

Related

composer install Doctrine/DBAL fails in Laravel 9 with PHP 8.2

I got an error when trying to install doctrine/dbal in order to add timestamp type according to laravel doc in order to allow changing timestamp column in migration.
Here is the message
composer require doctrine/dbal
Using version ^3.6 for doctrine/dbal
./composer.json has been updated
Running composer update doctrine/dbal
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- nette/schema v1.2.2 requires php >=7.1 <8.2 -> your php version (8.2.2) does not satisfy that requirement.
- league/commonmark 2.3.5 requires league/config ^1.1.1 -> satisfiable by league/config[v1.1.1].
- laravel/framework v9.30.0 requires league/commonmark ^2.2 -> satisfiable by league/commonmark[2.3.5].
- league/config v1.1.1 requires nette/schema ^1.2 -> satisfiable by nette/schema[v1.2.2].
- laravel/framework is locked to version v9.30.0 and an update of this package was not requested.
How can I deal with that ? Installing nette/schema before ?
It's saying that a depency cannot be updated / installed with your PHP version. Pay special atention to this line:
- nette/schema v1.2.2 requires php >=7.1 <8.2 -> your php version (8.2.2) does not satisfy that requirement.
You have to check another nette/schema version that support PHP version 8.2.2 (your version) or downgrade PHP

Laravel 5.5.x to 5.6.x upgrade requirements issue

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v5.6.0, ..., v5.6.40] require php ^7.1.3 -> your php version (8.1.2) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.6.* -> satisfiable by laravel/framework[v5.6.0, ..., v5.6.40].

jenssegers/mongodb dependecies issues with Laravel Sail - ext-mongodb

I'm trying to setup MongoDB in a Laravel Jetstream + Sail.
What I'm doing is trying to install the following packages:
mongodb/mongodb
jenssegers/mongodb
but I get the following errors :
Problem 1
- jenssegers/mongodb[v3.8.0, ..., v3.8.2] require mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0, ..., 1.9.x-dev (alias of dev-master)].
- mongodb/mongodb 1.9.x-dev is an alias of mongodb/mongodb dev-master and thus requires it to be installed too.
- mongodb/mongodb dev-master requires ext-mongodb ^1.10.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
- mongodb/mongodb[1.6.0, ..., v1.6.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.7.0-beta1, ..., v1.7.x-dev] require php ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.8.0-RC1, ..., v1.8.x-dev] require ext-mongodb ^1.8.1 -> it is missing from your system. Install or enable PHP's mongodb extension.
- Root composer.json requires jenssegers/mongodb ^3.8 -> satisfiable by jenssegers/mongodb[v3.8.0, v3.8.1, v3.8.2].
like suggested in this: Why does composer complain about the ext-mongo extension?
I added to my composer.json the following
"provide" : {
"ext-mongo": "*"
},
But nothing changed, I also tried adding the package:
"soyuka/stubs-mongodb": "^1.0",
But same problems.
Thanks
Mauro
The solution was to publish Sail docker files and add:
php8.0-mongodb
in /docker/8.0/DockerFile
Building and running:
sail composer require jenssegers/mongodb

Laravel Composer install failed with error in ubuntu

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for aws/aws-sdk-php 3.75.0 -> satisfiable by aws/aws-sdk-php[3.75.0].
- aws/aws-sdk-php 3.75.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
Problem 2
- Installation request for erusev/parsedown 1.7.1 -> satisfiable by erusev/parsedown[1.7.1].
- erusev/parsedown 1.7.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 3
- Installation request for laravel/framework v5.5.43 -> satisfiable by laravel/framework[v5.5.43].
- laravel/framework v5.5.43 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 4
- Installation request for league/csv 9.1.4 -> satisfiable by league/csv[9.1.4].
- league/csv 9.1.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 5
- Installation request for nicolaslopezj/searchable 1.10.3 -> satisfiable by nicolaslopezj/searchable[1.10.3].
- nicolaslopezj/searchable 1.10.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 6
- Installation request for phpoffice/phpexcel 1.8.1 -> satisfiable by phpoffice/phpexcel[1.8.1].
- phpoffice/phpexcel 1.8.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.
Problem 7
- Installation request for phar-io/manifest 1.0.1 -> satisfiable by phar-io/manifest[1.0.1].
- phar-io/manifest 1.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 8
- Installation request for phpunit/php-code-coverage 5.3.2 -> satisfiable by phpunit/php-code-coverage[5.3.2].
- phpunit/php-code-coverage 5.3.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 9
- Installation request for phpunit/phpunit 6.5.13 -> satisfiable by phpunit/phpunit[6.5.13].
- phpunit/phpunit 6.5.13 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 10
- Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
- theseer/tokenizer 1.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 11
- aws/aws-sdk-php 3.75.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- league/flysystem-aws-s3-v3 1.0.21 requires aws/aws-sdk-php ^3.0.0 -> satisfiable by aws/aws-sdk-php[3.75.0].
- Installation request for league/flysystem-aws-s3-v3 1.0.21 -> satisfiable by league/flysystem-aws-s3-v3[1.0.21].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
What is that error means? I have all extensions mentioned above are available and enabled in my php.ini.
Try running:
sudo apt install php7.2-mbstring php7.2-xml
You are missing these extensions from your system and/or they are not configured to be enabled with php. This will install and enable them in your php.ini file.

While installing Magento 2 on Ubuntu LTS 16.04, i am getting some different error

I have already installed these packages.
sudo apt-get install apache2 php libapache2-mod-php mysql-server php-mysql php-dom \
php-simplexml php-curl php-intl php-xsl php-mbstring php-zip php-xml composer
After this command
composer install
I am getting this error
Problem 1
- This package requires php ~7.1.3||~7.2.0 but your PHP version (7.0.32) does not satisfy that requirement.
Problem 2
- The requested PHP extension ext-bcmath * is missing from your system. Install or enable PHP's bcmath extension.
Problem 3
- The requested PHP extension ext-soap * is missing from your system. Install or enable PHP's soap extension.
Problem 4
- Installation request for magento/composer 1.4.0 -> satisfiable by magento/composer[1.4.0].
- magento/composer 1.4.0 requires php ~7.1.3|~7.2.0 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 5
- Installation request for php-amqplib/php-amqplib v2.7.3 -> satisfiable by php-amqplib/php-amqplib[v2.7.3].
- php-amqplib/php-amqplib v2.7.3 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
Problem 6
- Installation request for symfony/console v4.1.6 -> satisfiable by symfony/console[v4.1.6].
- symfony/console v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 7
- Installation request for symfony/event-dispatcher v4.1.6 -> satisfiable by symfony/event-dispatcher[v4.1.6].
- symfony/event-dispatcher v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 8
- Installation request for symfony/filesystem v4.1.6 -> satisfiable by symfony/filesystem[v4.1.6].
- symfony/filesystem v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 9
- Installation request for symfony/finder v4.1.6 -> satisfiable by symfony/finder[v4.1.6].
- symfony/finder v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 10
- Installation request for symfony/process v4.1.6 -> satisfiable by symfony/process[v4.1.6].
- symfony/process v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 11
- Installation request for zendframework/zend-code 3.3.1 -> satisfiable by zendframework/zend-code[3.3.1].
- zendframework/zend-code 3.3.1 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 12
- Installation request for zendframework/zend-soap 2.7.0 -> satisfiable by zendframework/zend-soap[2.7.0].
- zendframework/zend-soap 2.7.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
Problem 13
- Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 14
- Installation request for doctrine/collections v1.5.0 -> satisfiable by doctrine/collections[v1.5.0].
- doctrine/collections v1.5.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 15
- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 16
- Installation request for moontoast/math 1.1.2 -> satisfiable by moontoast/math[1.1.2].
- moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
Problem 17
- Installation request for myclabs/deep-copy 1.8.1 -> satisfiable by myclabs/deep-copy[1.8.1].
- myclabs/deep-copy 1.8.1 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 18
- Installation request for symfony/browser-kit v4.1.6 -> satisfiable by symfony/browser-kit[v4.1.6].
- symfony/browser-kit v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 19
- Installation request for symfony/config v4.1.6 -> satisfiable by symfony/config[v4.1.6].
- symfony/config v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 20
- Installation request for symfony/css-selector v4.1.6 -> satisfiable by symfony/css-selector[v4.1.6].
- symfony/css-selector v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 21
- Installation request for symfony/dependency-injection v4.1.6 -> satisfiable by symfony/dependency-injection[v4.1.6].
- symfony/dependency-injection v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 22
- Installation request for symfony/dom-crawler v4.1.6 -> satisfiable by symfony/dom-crawler[v4.1.6].
- symfony/dom-crawler v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 23
- Installation request for symfony/http-foundation v4.1.6 -> satisfiable by symfony/http-foundation[v4.1.6].
- symfony/http-foundation v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 24
- Installation request for symfony/options-resolver v4.1.6 -> satisfiable by symfony/options-resolver[v4.1.6].
- symfony/options-resolver v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 25
- Installation request for symfony/stopwatch v4.1.6 -> satisfiable by symfony/stopwatch[v4.1.6].
- symfony/stopwatch v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
Problem 26
- symfony/console v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
- sebastian/phpcpd 3.0.1 requires symfony/console ^2.7|^3.0|^4.0 -> satisfiable by symfony/console[v4.1.6].
- Installation request for sebastian/phpcpd 3.0.1 -> satisfiable by sebastian/phpcpd[3.0.1].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-dom.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gd.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-intl.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-simplexml.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
- /etc/php/7.0/cli/conf.d/20-wddx.ini
- /etc/php/7.0/cli/conf.d/20-xmlreader.ini
- /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.0/cli/conf.d/20-xsl.ini
- /etc/php/7.0/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
step1: first better to remove the php from your ubuntu using this command.
it will only remove php and its modules
sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
step2: PHP 7.1 isn’t available on Ubuntu default repositories… in order to install it,
you will have to get it from third-party repositories.
Run the commands below to add the below third party repository to install PHP 7.1
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
step:3
now install the required modules.
sudo apt-get install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-zip php7.1-curl composer
I got the same error, using this command error is resolved
sudo apt-get install php-bcmath php-soap

Resources