php mongodb connection in windows using wamp - php

I have the following error. My php version is 5.6, a x64 bit system and wamp. I downloaded the pecl driver "5.6 Thread Safe (TS) x64" and pasted inside ext folder in php and also edited the php.ini file.Restarted the local server. but still the error is coming.Anyone have any solution
the error is "The MongoDB PECL extension has not been installed or enabled."

The same issue happened to me because of wrong dll file.
Ensure the following things and download the correct dll file.
1) Your php version
2) Your system architecture (64 or 86)
3) Whether Thread safety enabled or not (You can check this in phpinfo())
Find DLL here

Related

Mongodb php extension loaded but class not found

I've download and install mongo and it's woring just fine, but when i tried to use it with Laravel I get some problems.
I downloaded mongodb PHP (TS) extension from pecl https://pecl.php.net/package/mongodb/1.4.0/windows and add it to my php extension
I've read other solutions but it just don't work;
The Class 'MongoDB\Driver\Manager' not found and even when i add phpinfo() in a page It doesn't display any mongodb extension
I'm using php 7.0 and wamp64 btw.
You need to download exact dll file which is match with your PHP version. phpinfo() will not show Mongodb if version doesn't match.
Ensure the following things and download the correct dll file.
1) Your php version
2) Your system architecture (64 or 86)
3) Whether Thread safety enabled or not (You can check this in phpinfo())
Download DLL here

php oci8 ext not loading Unable to load dynamic library

I am trying to connect my PHP 7.0 with Oracle database(11g release 2) for that I download dll files of oci8 extension from https://pecl.php.net/package/oci8/2.1.7/windows and copy php_oci8.dll and php_oci8_11g.dll in my xampp/php/ext after that I restart my xampp server.
My System type is: 64bit operating system x64 based processor
when using 7.0 Non Thread Safe (NTS) x64 extension getting this error on cmd
when using 7.0 Non Thread Safe (NTS) x84 extension getting this error on cmd
why these dynamic libraries are not loading what I need to do to connect php 7 with Oracle 11g release 2 in 64-bit windows 10 operating system please help me about this
Please check phpinfo to see if thread safety is enabled on your XAMPP server. (It seem to be enabled by default on xampp.) Also, check if your XAMPP is 32-bit or 64-bit. (There seems to be only 32-bit version available on Windows?) Then download OCI8 pecl package accordingly.
Here is what I got:
PHPInfo on my Windows Xampp server
Hence, I downloaded "7.1 Thread Safe (TS) x86".
FYI, oci8_2.1.8 is released this week. It fixes a critical reference count issue.

Loading Mongo Driver 1.6.x driver on WAMP 64bit architecture

So I've installed 64bit Apache/PHP locally. Both Apache and PHP were compiled against the VC11 C++ redistributable.
https://www.apachelounge.com/download/VC11/ and
http://windows.php.net/download/ PHP5.6 (Yes... ) x64 Thread Safe (respectively)
Both work fine! (screenshots with version and architecture info inc.)
I've downloaded multiple varaities of the 1.6.x driver from both PECL and an repo' at Amazon.
https://pecl.php.net/package/mongo/1.6.14/windows
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
I've made sure they're the x64 Thread Safe variety and added to my ~/php/ext folder.
I've made sure the extension is loaded in php.ini (and that the write .ini file is called):
extension=php_mongo-1.6.8-5.6-vc11-x86_64.dll
But everytime I restart Apache I get this in my PHP error log:
[07-Jun-2017 20:21:20 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'E:\PHP5.6\ext\php_mongo-1.6.8-5.6-vc11-x86_64.dll' - %1 is not a valid Win32 application.
(Apache comes up clean. Error.log clean)
Why is it protesting that this is not a Win32 Application. I don't want it to be. My entire architecture is 64bit and so is the Mongo Driver.
In case anyone else comes across this thread. After hours of trying to get it to run I just downgraded everything to 32-bit. Worked right out the gate.
Despite PECL offering a "64bit" driver - https://pecl.php.net/package/mongo/1.6.14/windows it didn't seem to be compatible with 64bit/VC11/Thread Safe versions of Apache/PHP
I'm not sure if this is an issue with the Mongo driver compilation or something deeper?
Anyway. Downgrade to 32-bit. Mongo 1.6.x drivers will then run.
From php.net
In order for this extension to work, there are DLL files that must be available to the Windows system PATH. For information on how to do this, see the FAQ entitled "How do I add my PHP directory to the PATH on Windows". Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the system's PATH), this is not recommended. This extension requires the following files to be in the PATH: libsasl.dll
http://php.net/manual/en/mongo.installation.php#mongo.installation.windows
Simply copy libsasl.dll from your PHP directory to your Apache\bin directory and restart Apache.
It is possible that a dependency is missing. Where I suspect that to be libsasl as alluded to in the comment at http://php.net/manual/en/mongodb.requirements.php
The libsasl.dll can be found in the PHP distribution.

memcache not showing in phpinfo()

I've followed each step to install and start memcache in windows. Didn't found any memcache.exe file(some tutorials told to use memcached.exe, so used it from link:http://downloads.northscale.com/memcached-win32-1.4.4-14.zip)
Executing following command in cmd with admin rights:
net start "memcached"
shows "The memcached service is starting. The memcached service was started successfully."
But result of phpinfo() does not show any memcache detail. Moreover php code is unable to find "memcahed" or "memcache" class.
I'm working on windows, using xampp(32bits).
PHP version 5.6.24
OS: Windows 8.1
Architecture: x86
Thread safety: enabled
Things already done:
-> added "extension=php_memcache.dll" to php.ini file(located at \xampp\php\php.ini)
-> verified locations of "extension_dir" variable and "php_memcache.dll"
-> no php_memcache.dll for version 5.2.0 was available, so tried with different versions but didn't work
->verified that both php and .dll are thread safe(TS).
Please let me know what I'm missing out?

PHP 5.4.16 and FreeTDS (php_dblib.dll): Unable to load extension

Goal
Connect to a MSSQL 2008 R2 server using the FreeTDS (php_dblib.dll 0.82 + 20110906 patches) Drivers for PHP 5.4.16 (VC9).
I am unable to use any alternative to FreeTDS unless the client also decides to use an alternative. This is unlikely unless they also run into this issue when upgrading their current version of PHP (currently 5.3.x) tomorrow.
Issue
PHP is unable to load the FreeTDS extension.
The Apache error log displays this on server start:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.16/ext/php_dblib.dll' - The specified module could not be found.\r\n in Unknown on line 0
As far as I understand it, the extension is either unable to be found or is the wrong version?
The extension directory location in the php.ini has been checked and triple checked and is:
c:/wamp/bin/php/php5.4.16/ext/
That leads me to believe it is the wrong version of php_dblib.dll. I've also checked that multiple times and made sure to use the version for PHP 5.4.X Thread Safe.
Steps Taken
Clean install of WAMP 2.4 with PHP 5.4.16 and Apache 2.4.4
Thread Safe php_dblib.dll placed in PHP extension directory
extension=php_dblib.dll added to the correct php.ini
extension=php_mssql.dll and extension=php_pdo_mssql.dll disabled in php.ini
msvcr71.dll (DotNet framework 1.1) added to PHP root directory
freetds.conf added to server root directory (c:)
System Details
WAMP Server 2.4
Apache 2.4.4
PHP 5.4.16 (VC9)
Thread Safety: enabled
FreeTDS Thread Safe (php_dblib.dll) 0.82 + 20110906 patches
Microsoft SQL Server 2008 R2
msvcr71.dll (DotNet framework 1.1) only included in the PHP root directory
EDIT:
WAMP 2.4 32-bit
OS: Windows 7 Pro 64-bit
EDIT 3
Last update only applied to the 64-bit version of WAMP. I've installed the 32-bit version, again, and --without-dblib is no longer in the configure command section of the phpinfo().
Questions
With the information given, is there anything else you'd need to know about to give an accurate assessment of the situation?
I am unable to find any, but are there any known issues with FreeTDS 0.82 and PHP 5.4.16?
Temporary Defeat
I've rolled back to PHP 5.3.x for now, FreeTDS works fine on that version. I'm not sure that it will make a difference with the little bit of code I am actually delivering to the client. This was intended to be a "double" check to make sure it all works perfectly, but since I'll be on site during the install I can fix any issues if they come up.
I would like to find a solution eventually since more and more of the systems I work with every day are going to be upgraded to php 5.4 and beyond.

Categories