PHP Mongodb installation issue on Linux Mint 17.3 Rosa - php

I am new to mongodb ,
I am following one tutorial and proceeding step by step , I installed mongodb and access it from shell .
Then I am doing php mongodb installation part .
I am doing it through composer , install composer and run the below command
composer require mongodb/mongodb
I am getting this below error output in my terminal .
$ composer require mongodb/mongodb
Using version ^1.4 for mongodb/mongodb
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.4.0, 1.4.1, 1.4.2].
To enable extensions, verify that they are enabled in your .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-json.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
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, deleting ./composer.json.
Here I added this things to my php.ini file and restarted the apache file.
extension = mongodb.so
PHP VERSION - PHP 5.5.9 AND Linux Mint 17.3 Rosa
Any suggestion?
where I am doing wrong

Related

Magento installation not working after editing php.ini

I tried to install Magento 2.4.5 on windows I am using windows 8.1 by the way and I downloaded xampp8.1.12, composer 2.4.4, and when I typed this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
I got this 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.5-p1 -> satisfiable by magento/product-community-edition[2.4.5-p1].
- magento/product-community-edition 2.4.5-p1 requires ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
Problem 2
- magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
- Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files PHP uses in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-intl` to temporarily ignore these required extensions.
The strange thing is that I removed the comma from all of these extensions in the php.ini file:
extension=gd
extension=intl
extension=soap
extension=sockets
extension=sodium
extension=xsl
and I still have the same error
and by the way, when I restart xampp I get this error:
The Procedure entry point crypto_core_ristretto255_scalar _ reduce could not be located in the dynamic link library C:\xampp8.1\php\ext\php_sodium.dll
I tried running this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
but it didn't work
Please make sure below all extensions are enabled in php.ini
sodium
ext-bcmath
ext-ctype
ext-curl
ext-dom
ext-gd
ext-hash
ext-iconv
ext-intl
ext-mbstring
ext-openssl
ext-pdo_mysql
ext-simplexml
ext-soap
ext-xsl
ext-zip
ext-sockets

Cannot Update Composer in Command Line

I am updating the composer and it shows up some error like below.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- pusher/pusher-php-server v3.4.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server v3.4.0 requires php >=5.4 <7.3 -> your PHP version (7.3.6) does not satisfy that requirement.
- pusher/pusher-php-server v3.3.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server v3.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server 3.4.x-dev requires ext-curl * -> the requested PHP extension curl is missing from your system.
- Installation request for pusher/pusher-php-server ^3.3 -> satisfiable by pusher/pusher-php-server[3.4.x-dev, v3.3.0, v3.3.1, v3.4.0, v3.4.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\PHP7\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
the pusher v3 doesn't support php version that higher than 7.3
there are some options :
first is downgrade the php to the requirement (not recomended), the second one is use this command to upgrade the pusher to version 4
composer require pusher/pusher-php-server
could please check curl enabled in your php use ;extension=php_curl.dll remove semi colon in php.ini file and try
try following command
install first curl using following command.
sudo apt-get install curl
then use
sudo apt-get install composer

Composer can't find mongodb extension

When executing composer require jenssegers/mongodb:
$ composer require jenssegers/mongodb
Using version ^3.0 for jenssegers/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
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
ers/mongodb[v3.0.0, v3.0.1, v3.0.2].
To enable extensions, verify that they are enabled in those .ini files
- C:\wamp\bin\php\php5.5.12\php.ini
You can also run php --ini inside terminal to see which files are us
P in CLI mode.
Installation failed, reverting ./composer.json to its original content.
I am running Windows 7 and PHP 5.5.12 use mongodb 3.2 . I installed the mongodb extension (php_mongodb.dll in PHP ext/ folder), and I've updated php.ini with extension=php_mongodb.dll. Not sure what I've missed
There are two kinds of drivers available at pecl
You need to install the mongoDB database driver. As you explained it looks like you have installed the mongoDB driver for PHP which is not correct
and you have to add php_mongo.dll in your php.ini
extension=php_mongo.dll
as explained here
get the proper DLL from here
You will get something like this in your phpinfo();
I hope this helps. Thanks,

Laravel with drivers of MongoDB

I'm new using MongoDB in laravel, I want to use laravel 4.2 with MongoDB but I have this problem:
> C:\xampp\htdocs\laravel-mongo>composer require jenssegers/mongodb
Using version ^3.0 for jenssegers/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
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 has the wrong version (1.0.0) installed.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb has the wrong version (1.0.0) installed.
- 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:
- C:\xampp\php\php.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.
For Laravel 4.2 you would need 2.0.x version of the package
composer require jenssegers/mongodb ^2.0
When you don't specify the version composer grabs the latest stable release by default, which currently happens to be v3.0.2.
This happened to me (for Lumen 5) due to an old mongo installation.
From http://php.net/manual/en/class.mongoclient.php:
Warning: This extension that defines this class is deprecated. Instead,
the MongoDB extension should be used.
Following next steps I was able to get jenssegers/mongodb properly working:
sudo apt-get install php5-dev
sudo pecl install mongodb
Then add to /etc/php5/cli/php.ini or similar:
extension=mongodb.so
And then install the driver
composer require jenssegers/mongodb
ref: http://haafiz.me/development/installing-mongodb-driver-mongoclient-for-php-on-ubuntu

Getting the error message when running ' composer require google/apiclient:"^2.0" '

When I run this command composer require google/apiclient:"^2.0" I get these error messages:
Problem 1
mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP
extension mongodb is missing from your system.
mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP
extension mongodb is missing from your system.
Installation request for mongodb/mongodb (locked at 1.5.1, required as
^1.5) -> satisfiable by mongodb/mongodb[1.5.1].
To enable extensions, verify that they are enabled in your .ini files:
C:\PHP7\php.ini
You can also run php --ini inside terminal to see which files are used by PHP
in CLI mode.
Can someone explain to me why this is happening as I am quite new to Php & composer ?
It looks like the mongodb extension is causing the issues. I dont need mongodb anymore and I deleted the ;extension=php_mongodb.dll lines in my Php.ini files
You still have mongodb referenced in either your composer.json, or composer.lock. Double-check your composer.json, delete your composer.lock, and then run your composer command again.

Categories