I want to use mongodb with yii framework for that i am trying to install mongodb extension. As per the documentation given at http://www.yiiframework.com/doc-2.0/ext-mongodb-index.html i have already added line ""yiisoft/yii2-mongodb": "~2.0.0"" in my composer.json file.
But whenever i issue command composer update to install this extension it gives me below error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2-mongodb 2.0.4 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
- yiisoft/yii2-mongodb 2.0.3 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
- yiisoft/yii2-mongodb 2.0.2 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
I search a lot on this issue and found one solution here https://github.com/yiisoft/yii2-mongodb/issues/18 and here http://www.yiiframework.com/forum/index.php/topic/57726-solved-yii2-mongodb/ that suggest to add line extension=mongo.so in my /etc/php5/cli/php.ini file . but even after adding line to php.ini file command composer update still gives the same error.
Please help
I forgot to install mongodb php extension. after installing this extension it works. here is the link to install mongodb extension http://us1.php.net/manual/en/mongo.installation.php
Related
I'm having difficulty running composer install on Jenkins.
I have a Jenkins job that I need to run composer install for. I have installed php7.2 and composer. When I run the command, I get the following errors:
composer install
Problem 1
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- Installation request for teamtnt/tntsearch v1.3.2 -> satisfiable by teamtnt/tntsearch[v1.3.2].
So I install sqlite using the following command: sudo apt-get install php7.2-sqlite3
After this, I get the additional warning, and the error persists.
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite.so'
(tried: /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so:
undefined symbol: sqlite3_column_table_name), /usr/lib/php/20170718/pdo_sqlite.so.so
(/usr/lib/php/20170718/pdo_sqlite.so.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
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
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- Installation request for teamtnt/tntsearch v1.3.2 -> satisfiable by teamtnt/tntsearch[v1.3.2].
When I ssh into the Jenkins box and run composer install from the workspace directory, everything runs as expected and the vendor directory is generated with no errors.
I have spent a lot of time looking at the answers to existing questions on StackOverflow.
I've purged everything that is not php7.2, and removed any previous versions of my machine.
I have also installed the php7.2-pdo_sqlite, and ensured that it is displayed in the php.ini file.
I've also tried completely removing php (and checked using php -v) and then reinstalled php7.2.
When I run php --ini I see /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini, and
/etc/php/7.2/cli/conf.d/20-pdo_sqlite.ini displayed on the list.
I have also given READ permissions to /usr/lib/php/20170718/pdo_sqlite.so incase it was due to a permission error.
What else can I do to resolve the error above? - my goal is to be able to run composer install.
Workaround
If your build pipeline doesn't require sqlite to be installed, you can bypass the check for platform requirements with --ignore-platform-reqs, like so:
composer install --ignore-platform-reqs
From the documentation:
--ignore-platform-reqs: ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill
these. See also the platform config option.
If you have tests that assert sqlite functionality, this isn't a solution, unfortunately.
The PHP exe file you specified did not run correctly:
C:\xampp\php\php.exe
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
Program Output:
Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match in Unknown on line 0
Update
Composer can't find mongodb extension in php
C:\wamp\www\phpmongodb>composer require "mongodb/mongodb=^1.0.0"
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./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
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- 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.
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1, 1.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 used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match in Unknown on line 0
Problem
This is a PHP Extension installation issue.
The error means, that the PHP Extension mongo doesn't fit your PHP version.
It's incompatible.
Solution
The solution is to check your PHP version with php -v and then install the matching "mongo" extension.
PHP Extension Mongo https://pecl.php.net/package/mongo + http://php.net/mongo/
Reminder: The PHP extension Mongo is deprecated. The replacement is MongoDB https://pecl.php.net/package/mongodb + http://php.net/mongodb/
Another simple solution is to delete the php_mongo.dll from the extension folder and remove it from php.ini to allow a proper PHP start.
After that, Composer and all other PHP CLI applications should work normally.
Answer for the updated question
the requested PHP extension mongodb is missing from your system
Now, mongodb is missing:
Download
drop php_mongodb.dll into the extension folder
edit your php.ini to include the extension.
I am installing ORO-Plateform on my windows system. I download the package from its official site and put it in the xampp/htdocs folder. While i run this command "composer install --prefer-dist --no-dev". I am getting below error.
Problem 1
- Installation request for zendframework/zend-i18n 2.1.5 -> satisfiable by zendframework/zend-i18n[2.1.5].
- zendframework/zend-i18n 2.1.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
How can i resolve this? Please help me. Any help would be appreciate.
As stated in the error zendframework/zend-i18n requires intl php extension to be installed. This extension is bundled with PHP as of version 5.3.0, so open php.ini and uncomment ;extension=php_intl.
Also, take a look at the installation guide php.net Intl Installing/Configuring
I added the mongo.so extension in /etc/php5/apache2/php.ini and its loading perfectly in php info.
But not working with /etc/php5/cli/php.ini
Because when i try to run composer for adding mongodb lib
it gives this error
mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0
the requested PHP extension mongodb is missing from your system.
Do anyone know what is the problem ?
mongo.so (ext-mongo) is for legacy driver while ext-mongodb is the new driver
I am trying to setup the UserVoice PHP SDK in my local machine using Composer. I am following the manual specified at https://developer.uservoice.com/docs/api/php-sdk/. I have both oauth and mcrypt php extensions enabled.
The composer.js files contains the following,
{
"require": {
"uservoice/uservoice": ">=0.0.6"
}
}
But when I try php composer.phar install command, I am getting the following errors in terminal.
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- uservoice/uservoice 0.0.9 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.8 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.7 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.6 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- Installation request for uservoice/uservoice >=0.0.6 -> satisfiable by uservoice/uservoice[0.0.6, 0.0.7, 0.0.8, 0.0.9].
php.ini file is configured with the extensions. I have tried restarting the apache server after installation of these extension, still issue persists.
what is that am missing here?
If you are on Ubuntu you can use the Ondrej Sury PHP PPA. After adding this PPA to your system, you can install the oauth extension package with aptitude install php5-oauth.
Instructions for adding a PPA depend on which Ubuntu version you're on. For 12.04 you need to install python-software-properties and then you can use add-apt-repository command.