2

I have been trying to run MongoDB on WAMP all day and It shows the error: Fatal Error: MongoClient class not found. I have a windows 64 bit, Wamp 32 bit ( after trying and failing at running wamp 64), MongoDB 64 bit. I downloaded mongo php_driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. Copied php_mongo-1.5.1-5.4-vc9.dll to the php extension folder as php_mongo.dll. Added it as extension in php.ini (configuration setting file). My php.ini extension section looks like this:

extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_mongo.dll

I've reboot the server. I don't see Mongo on the phpinfo() file and also the php error log files shows the following:

c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.
 PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - %1 is not a valid Win32 application.

PHP Warning: PHP Startup: mongo: Unable to initialize module

Please tell me what I am missing because I have tried everything.

Thank you!

Iva
  • 47
  • 2
  • 7

1 Answers1

3

To fix the php_intl.dll error do the following using the wmapmanager menus

wampmanager -> Apache -> Version -> and click on the 2.4.9 version number

This will cause wampmanager to rebuild all the SYMLINKS in the \wamp\bin\apache\apache2.4.9\bin folder.

As to the mongo error, are you sure you are editing the correct php.ini file.

Again use the wampmanager menu system to edit the correct php.ini file

wampmanager -> PHP -> php.ini

I expect the extension was not added to this file so add

extension=php_mongo.dll

like you did to the PHP CLI version of the ini file.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Thank you, the error for php_intl.dll error went away after rebuilding. But is still shows: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_mongo.dll' - %1 is not a valid Win32 application. I have tried many mongo php_drivers and now have the php_mongo-1.5.1-5.4-vc9.dll, but is still doesn't work. – Iva Aug 26 '14 at 09:50
  • 1
    So apperantly I was just using a wrong mongo php_driver. I downloaded the pacakge php_driver 1.1.5 and tried some of the .dll files. php_mongo-1.5.1-5.5-vc11.dll is working fine for me now. Thank you! – Iva Aug 26 '14 at 10:14
  • Gosh!! I don't believe editing the `php.ini` by clicking on `wampmanager` worked!! I wonder where does this `php.ini` reside? I have just one version of php installed and I had already tried editing that file to enable the extension but this answer hinted me to open `ini` file using wampmanager and it didn't have that line!! – Fr0zenFyr Dec 16 '16 at 05:52
  • By the way, thanks!! I see that you quite active on wampserver forums also... came across several of your posts there too. Doing a great job, keep it up! – Fr0zenFyr Dec 16 '16 at 06:00