Install mongodb with lumen in widows system - php

I want to use mongodb with lumen framework (which is micro framework of laravel)
I have followed steps
check from my computer my system in 64bit windows
download dll file for 64 bit for mongodb download two zips and try both php_mongodb-1.5.3-7.0-nts-vc14-x64.zip , php_mongodb-1.5.3-7.0-ts-vc14-x64.zip
3.put dll file in php/ext
enable extension for mongodb in php.ini file extension=php_mongodb.dll
restart apache
now I want use jenssegers/mongodb
I have fire command as below:
composer require jenssegers/mongodb
It gives bwlow error
PHP Warning: PHP Startup: Unable to load dynamic library 'E:\xampp7\php\ext\php_mongodb.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'E:\xampp7\php\ext\php_mongodb.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
I have check phpinfo , it not shows me detail of mongo

https://laravel.com/docs/5.7/homestead is a solution for this and much more, very handy.

Related

Adding mongodb driver to laravel project

I'am trying to add mongodb driver for my laravel project, my php installed version is 7.4.26 i started by downloading the php_mongodb.dll 7.4 Thread Safe (TS) x86 from here then i added the php_mongodb.dll into C:/xampp/php/ext folder and edited the php.ini file by adding extension=php_mongodb.dll after that i tried to run composer require jenssegers/mongodbin order to add the MongoDB package for my Laravel 8 application i keep getting this error
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll'
(tried: C:\xampp\php\ext\php_mongodb.dll (%1 is not a valid Win32 application.),
C:\xampp\php\ext\php_php_mongodb.dll.dll (The specified module could not be found.)) in Unknown on line 0
And when i try to run php -m command to list the php modules i can't find the mongodb module that i just added

Not able to load php_grpc.dll for php 5.6 in xampp for windows

I am trying to use google cloud php sdk to fetch from google bigtable and found that it requires grpc to be enabled.
So i tried installing grpc on my xampp by downloading dll file from https://pecl.php.net/package/gRPC
I am running PHP version 5.6 on using xampp on my windows machine
I also updated my php.ini file by adding below
extension=php_grpc.dll
I restarted apache and printing phpinfo but i am not able to find grpc module loaded.
I also checked the list of extensions loaded by running php -m command and i get below error.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Can anyone provide me a solution?
I was facing the same issue when installing the Google Ads PHP library on WAMP Server. I solved it downloading a different gRPC version
https://windows.php.net/downloads/pecl/releases/grpc/1.17.0/
Extacted the file and copied on the extensions directory of WAMP and on the php.ini just add the next line
extension=grpc
Restart apache and php. Hope it helps

Xampp php_zmq.dll Unable to load

i know this question has been asked before but, i can't solve my problem.
my php version is PHP Version 7.0.13
the Architecture is x86
and my apache version is Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.13
i try to install the zmq with composer and here is the composer require part
"react/zmq": "0.2.*|0.3.*"
how ever i got this message
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_zmq.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_zmq.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
https://pecl.php.net/package/zmq/1.1.3/windows
i try to install all pacakage that available in that link, than copy the php_zmq.dll and libzmq.dll to the part where they should, and i already write the extension to in my php.ini
[ZMQ]
extension=php_zmq.dll
but all i always get that following error. Someone can help me what should i do?
thank you

Redis for php 5.4 got fatal error Class 'Redis' not found in Windows machine

I'm using php 5.4.12 which installed extension php_redis and php_igbinary that was downloaded at https://github.com/nicolasff/phpredis/downloads.
There are 2 version: thread version and non thread version. First i try with the first one. Copy 2 file php_redis and php_igbinary to ext folder of php, edit php.ini config for load extension and seem to successful
After that, i run myfile.php that has command: $redis = new Redis(); -> it got fatal error: CLASS REDIS IS NOT FOULD.
I have tried with others version (non thread) but i got similar.
Anybody know about this
Tks in advance
UPDATE:
I look at apache error log. Got this:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.12/ext/php_igbinary.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.12/ext/php_redis.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
This is a version mismatch. You're using the 64-bit php_redis.dll instead of the 32-bit. Download and paste the 32-bit version for php 5.3-5.6 from here into your php/ext folder and add the following line to your php.ini:
extension=php_redis.dll
Versions for php 7.0-7.1 can be found at: https://pecl.php.net/package/redis/3.1.0/windows
I downloaded the .dll here. It only worked when choosing the thread-safe (TS) one.
It is important to pay attention to the correct version of PHP.

PHP Startup: Unable to load dynamic library

I am trying to use Firebird 2.5.2.26539 with:
Windows 8
Apache 2.2.22
PHP 5.4.10
When i enable the extensions of firebird in php:
- extension=php_interbase.dll
- extension=php_pdo_firebird.dll
I get these errors:
[26-Dec-2012 12:08:11 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - Impossible to locate the specified module.
in Unknown on line 0
[26-Dec-2012 12:08:13 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - Impossible to locate the specified module.
in Unknown on line 0
if i make PHP -a in command line, the error message is different: cannot find fbclient.dll.
I have the flamerobin running and it opens the database. So i copy the fbclient.dll to the PHP root path.
Then the errors change to:
[26-Dec-2012 11:55:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
[26-Dec-2012 11:55:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
Can anyone help me on this one? I suspect that this version of Firebird still does not have the correct extensions made for the PHP.
Thank you.
I am repeating the comment (which some might miss) by Nenhum Pois é above, because it is the real solution to the problem:
The problem was the fbclient.dll from the FB 64 bits installation. I just got the fbclient.dll from 32bits, copy it into the PHP root and it solved the problem
Cli and Apache PHP run with two different configuration files. That will explain the lacking error message in CLI mode. The likelihood is the extensions for this application where not stored in the PHP extension folder. I'm not versed with the configurations under windows so you may need to google for the Windows PHP extension directory and ensure your extension file is there.
Judging by your error the path is "C:\Program files(x86)\PHP\ext\
Please ensure your extension files are there before attempting to load them.
If you run on Windows check if your extension is compiled with the same Visual Studio compiler version as your PHP interpreter.
From PHP download page https://windows.php.net/download
PHP 7.3 = VC15
PHP 7.1 = VC14
PHP 5.6 = VC11
Whereas the MongoDB extension for examples is compiled with VC11, see https://pecl.php.net/package/mongo/1.6.16/windows and check the DLL list filename for -vc11-

Categories