php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73050 Not able to make mongodb to work in Bitnami wampstack-5.6.20-0
Submitted: 2016-09-08 20:59 UTC Modified: 2016-09-10 23:19 UTC
From: g dot statkute at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.6.25 OS: Windows 10
Private report: No CVE-ID: None
 [2016-09-08 20:59 UTC] g dot statkute at gmail dot com
Description:
------------
Everything is described here:
http://stackoverflow.com/questions/39397930/how-to-install-mongodb-on-bitnami-wamp-windows-for-using-with-symfony-3

 Symfony installation (does not work)
composer.json

    "require": {
        "doctrine/mongodb": "dev-master",
        "alcaeus/mongo-php-adapter": "^1.0.0",
        "doctrine/mongodb-odm": "~1.1",
        "doctrine/mongodb-odm-bundle": "~3.0",

2a) I followed the steps 
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`.

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",

Test script:
---------------
it is installation problem


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-09 13:39 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-09-09 13:39 UTC] cmb@php.net
I presume that wampstack-5.6.20-0 is build for x86, so you should
use the respective x86 php_mongo.dll. Check phpinfo() regarding
whether you need the thread-safe or non-thread-safe version.
 [2016-09-10 19:30 UTC] g dot statkute at gmail dot com
-Status: Feedback +Status: Assigned
 [2016-09-10 19:30 UTC] g dot statkute at gmail dot com
You are right: i have x86 architecture.  
System 	Windows NT AMBER 10.0 build 10586 (Windows 10) i586
Build Date 	Mar 31 2016 14:47:48
Compiler 	MSVC11 (Visual C++ 2012)
Architecture 	x86 

I have tried both: thread safe and tread non-safe mongodb installation, and many versions. How to choose  thread-safe or non-thread-safe version with pecl?


Now it works, thus does not matter. Maybe i made some mistake somewhere. As i wrote, to make mongodb to work,  i have opied mongodb.dll and mongo.dll from Bitnami MeanStack to WampStack and restarted apache. Mongodb worked in htdocs/index.php or in htdocs/symfony_project/controller/SomeController.php . 

Nevertheless, the instllation of packages related to mongodb using composer is still not working. I am getting the error `doctrine/mongodb dev-master requires ext-mongo ^1.5` .

composer.json

    "require": {
        "doctrine/mongodb": "dev-master",
        "alcaeus/mongo-php-adapter": "^1.0.0",
        "doctrine/mongodb-odm": "~1.1",
        "doctrine/mongodb-odm-bundle": "~3.0",
 [2016-09-10 19:49 UTC] cmb@php.net
-Status: Assigned +Status: Not a bug
 [2016-09-10 19:49 UTC] cmb@php.net
> How to choose thread-safe or non-thread-safe version with pecl?

Frankly, I don't know, but I wouldn't recommend using the pecl
installer on Windows. Just download the appropriate DLLs of the
respective PECL package directly.

> Nevertheless, the instllation of packages related to mongodb
> using composer is still not working. I am getting the error
> `doctrine/mongodb dev-master requires ext-mongo ^1.5` .

Apparently, doctrine/mongodb requires PECL/mongo[1], but not
PECL/mongodb[2].

[1] <https://pecl.php.net/package/mongo>
[2] <https://pecl.php.net/package/mongodb>
 [2016-09-10 21:40 UTC] g dot statkute at gmail dot com
Thank you so much for replying on late Saturday evening.
Everything works with thread safe version x86. 

p.s.
There could be more instructions on pecl website how to install for the beginners.
 [2016-09-10 23:19 UTC] cmb@php.net
> Everything works with thread safe version x86.

Fine!

> There could be more instructions on pecl website how to install
> for the beginners.

There is rather good documenation available on
<http://php.net/manual/en/install.pecl.windows.php>. On the PECL
start page there's a link to "PECL specific docs", and that page
links to "How to install a PECL extension", which leads to Windows
installation instructions. Not so bad at all. :-)

Also note that there are several support channels available, see
<http://php.net/support.php>. :-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 09:01:30 2024 UTC