PHP startup mongo: Unable to initialize module

不羁岁月 提交于 2019-12-05 04:25:58
Stennie

It looks like you're trying to install an extension compiled for PHP 5.3 with PHP 5.4; the module API version needs to match the version of PHP.

If you download the precompiled MongoDB PHP driver from Github (eg. php_mongo-1.2.12.zip is the current stable version) it includes DLLs for multiple PHP versions (eg 5.2, 5.3, and 5.4). You need to copy the correct DLL for your system and rename it php_mongo.dll.

You can determine the required version from the phpinfo() output on your system (or php -i from a command line). Check the value for "Zend Extension Build".

For example:

Zend Extension Build => API220100525,NTS,VC9

.. would indicate you should use the NTS (Non-threadsafe) DLL.

On 64-bit Windows, that would mean copying php_mongo-1.2.12-5.4-vc9-nts-x86_64.dll to php_mongo.dll in your PHP extension directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!