Windows 10, x64.
php PHP 5.6.20 (cli) (built: Mar 31 2016 14:56:44).
I have tried mongodb releases from 1.1.1 to 1.1.8
from http://pecl.php.net/package/mongodb
I managed to download and install mongodb on windows. But i am not able to use it with WAMP and symfony.
1) WINDOWS installation (working) –
1) download msi from :
https://www.mongodb.com/download-center#community
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/
Remember where DB is installed – on , and
Add this path to system variables : C:\Program Files\MongoDB\Server\3.2\bin
run cmd: mongod
Create a folder for your database files, for example on C:\Bitnami\mongodb
and run command
c:\Users\gintare>mongod --dbpath C:\Bitnami\mongodb
This will create a database in the folder.
2) Symfony installation (does not work)
composer.json
Expand|Select|Wrap|Line Numbers
- "require": {
- "doctrine/mongodb": "dev-master",
- "alcaeus/mongo-php-adapter": "^1.0.0",
- "doctrine/mongodb-odm": "~1.1",
- "doctrine/mongodb-odm-bundle": "~3.0",
http://php.net/manual/en/mongo.installation.php#mongo.installation.windows
Downloaded `mongodb.dll 1.8.8` from
http://pecl.php.net/package/mongodb
unzipped to:
`C:\Bitnami\wampstack-5.6.20-0\php\ext\php_mongodb-1.1.8-5.6-ts-vc11-x64`
I tried both thread safe and unsafe versions. Both gave the same errors.
and copied file `php_mongodb.dll` to `C:\Bitnami\wampstack-5.6.20-0\php\ext`
and corrected `php.ini` by adding `extension=php_mongodb.dll`. Restarted Apache from Bitnami.
Nevertheless iam getting the error` Unable to load dynamic library`:
c:\Bitnami\wampstack-5.6.20-0\apache2\htdocs\sym\patmonS1>php
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-5.6.20-0/php/ext\php_mongodb.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
2b) If i try to install using pecl, i am getting the error `invalid package`:
:\Bitnami\wampstack-5.6.20-0\php\ext>pecl install mongodb
downloading mongodb-1.1.8.tgz ...
Starting to download mongodb-1.1.8.tgz (806,900 bytes)
.................................................. .................................................. .................................................. ...........done: 806,900 bytes
could not extract the package.xml file from "C:\Bitnami\wampstack-5.6.20-0\php\pear\download\mongodb-1.1.8.tgz"
Download of "pecl/mongodb" succeeded, but it is not a valid package archive
Error: cannot download "pecl/mongodb"
Download failed
install failed
2c) If i try to install mongoDB with composer, i am getting the error `doctrine/mongodb dev-master requires ext-mongo ^1.5` .
c:\Bitnami\wampstack-5.6.20-0\apache2\htdocs\sym\patmonS1>composer update
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-5.6.20-0/php/ext\php_mongodb.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
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
- Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
- doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
Problem 2
- alcaeus/mongo-php-adapter 1.0.0 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- alcaeus/mongo-php-adapter 1.0.1 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- alcaeus/mongo-php-adapter 1.0.2 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- alcaeus/mongo-php-adapter 1.0.3 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- alcaeus/mongo-php-adapter 1.0.4 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- alcaeus/mongo-php-adapter 1.0.5 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
- 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.
- Installation request for alcaeus/mongo-php-adapter ^1.0.0 -> satisfiable by alcaeus/mongo-php-adapter[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5].
To enable extensions, verify that they are enabled in those .ini files:
- C:\Bitnami\wampstack-5.6.20-0\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
c:\Bitnami\wampstack-5.6.20-0\apache2\htdocs\sym\patmonS1>
"doctrine/mongodb-odm": "~1.1",