Trying to install mongo-php-adater for mongodb use with symfony4 issue - mongodb

I am trying to install mongo-php-adapter to use mongoDB with Symfony 4, but I have the following problem:
Problem 1
    - alcaeus/mongo-php-adapter 1.1.6 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.5 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.4 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.3 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.1 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.0 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for alcaeus/mongo-php-adapter ^1.1 -> satisfiable by alcaeus/mongo-php-adapter[1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6].
 
  To enable extensions, verify that they are enabled in your .ini files:
    - /opt/lampp/etc/php.ini
  You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
I installed php-mongo and put extension=mongodb.so in the php.ini file but it doesn't change anything on the contrary it says it can't find the mongodb.so file.
I also installed mongodb with pecl but still the same problem.
Thank you in advance for your help

Related

how to fix issue when magento upgrade from 2.3.4 to 2.4.3?

I'd like to upgrade magento from 2.3.4 to 2.4.3.
But I cannot upgrade it.
this is error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/product-community-edition 2.4.3 -> satisfiable by magento/product-community-edition[2.4.3].
- magento/product-community-edition 2.4.3 requires php ~7.3.0||~7.4.0 -> your php version (7.2.34) does not satisfy that requirement.
Problem 2
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.2.0] but it does not match the constraint.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I am using cpanel now. In cpanel I set php version is 7.4
PHP 7.4.33 (cli) (built: Nov 10 2022 11:12:07) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
what is the reason?
See if you're really using php 7.4 by typing php -v in the terminal. When you are sure that your php version is correct, delete the composer.lock file (make a backup beforehand). Try updating with the command:
composer require magento/product-community-edition:2.4.5 -W
If that doesn't work, post the contents of the composer.json file
If you are migrating from 2.3.4 to 2.4.3, you need to make the following and please follow these below steps:
1: Backup composer.json: Run the command
cp composer.json composer.json.bak
2: Upgrade your Magento: Run the commmand
composer require-commerce magento/<product> <version> --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]
3: Update the dependecies:
composer update
For example, Specify the metapackage:
Magento Open Source: composer require-commerce magento/product-community-edition 2.4.4 --no-update
Adobe Commerce: composer require-commerce magento/product-enterprise-edition 2.4.4 --no-update
4: Composer Update: Run composer update
5: Update the database schema and data. bin/magento setup:upgrade
6: Disable Magento maintenance mode. bin/magento maintenance:disable
7: Restart Varnish. (Optional) Restart Varnish If you use it for page caching: service varnish restart
Please switch to PHP 7.4 first then check perform the upgrade.

How to install mongodb-odm on symfony4 with php 7.3 (Windows 10)?

I am trying to install mongodb-odm on symfony4 (php 7.3), but getting those problems
Problem 1
- doctrine/mongodb-odm 2.0.5 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb-odm 2.0.4 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb-odm 2.0.3 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb-odm 2.0.2 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb-odm 2.0.1 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb-odm 2.0.0 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
- Installation request for doctrine/mongodb-odm ^2.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].
When I try to install composer require mongodb/mongodb I'm getting
Problem 1
- Installation request for mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0].
- mongodb/mongodb 1.6.0 requires ext-mongodb ^1.7 -> the requested PHP extension mongodb is missing from your system.
I see in phpinfo(); that mongodb is installed (MongoDB extension version 1.7.2), but when I type php -m, I don't see mongo there.

How install PHP extension mongodb on MAMP

I installed yii2, composer and MAMP
but when i do composer update i have error
- yiisoft/yii2-mongodb 2.1.7 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.6 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.5 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.4 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.3 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.2 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.1 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- yiisoft/yii2-mongodb 2.1.0 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for yiisoft/yii2-mongodb ^2.1 -> satisfiable by yiisoft/yii2-mongodb[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7].
I surfed the entire Internet and did not find a solution
to mongodb extension install do
sudo apt-get install php-mongodb

Component dependency issue when upgrading Magento 2 from 2.0.7 to 2.1.0

I need to upgrade from magento 2 2.0.7 to 2.1.0. I tried by using composer commands.
composer require magento/product-community-edition 2.1.0 --no-update
composer update
But I got an error like below:
Can only install one of: magento/framework[100.1.0, 100.0.9].
Can only install one of: magento/framework[100.1.0, 100.0.10].
magento/product-community-edition 2.1.0 requires magento/framework 100.1.0 -> satisfiable by magento/framework[100.1.0].
Installation request for magento/product-community-edition 2.1.0 -> satisfiable by magento/product-community-edition[2.1.0].
Could someone please give me some ideas?

Error to install mongodb in lumen

I use Lumen micro framework on ubuntu 14.4,when i want to install monogodb packege form this link i got a error like below:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php5/cli/php.ini
- /etc/php5/cli/conf.d/05-opcache.ini
- /etc/php5/cli/conf.d/10-pdo.ini
- /etc/php5/cli/conf.d/20-curl.ini
- /etc/php5/cli/conf.d/20-gd.ini
- /etc/php5/cli/conf.d/20-json.ini
- /etc/php5/cli/conf.d/20-mcrypt.ini
- /etc/php5/cli/conf.d/20-mysql.ini
- /etc/php5/cli/conf.d/20-mysqli.ini
- /etc/php5/cli/conf.d/20-pdo_mysql.ini
- /etc/php5/cli/conf.d/20-readline.ini
- /etc/php5/cli/conf.d/mongo.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
How can i fix it?
You don't have the php mongodb driver/extension installed
use this
sudo apt-get install php5-mongo
if you are on php 5
When i run php -m i got :
amirali#amirali-U30J:~$ php -m
PHP Warning: Module 'mongo' already loaded in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mongo
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
Use pecl instead.
pecl install mongodb
See here.