Windows MongoDB PHP extension not load [duplicate] - php

This question already has answers here:
PHP Startup Unable to load dynamic library php_mongo.dll
(7 answers)
Closed 4 years ago.
I'm trying to install the mongodb extension in PHP 7.1.0 but basically the extension is not loaded by PHP (not displayed using php_info() and not throws any error, just not load), i have follow and searched too many tutorials and nothing has worked.
MongoDB 4.0.2 is installed and working as expected. PHP 7.1 is working as expected.
Steps made:
1) Download PECL compatible (PHP version and thread safety/no thread safety) mongodb driver.
2) Open /ext directory in PHP installation and put the .dll extension downloaded on it.
3) Edit php.ini file and enable the mongodb extension appending the code using (extension=php_mongodb.dll).
4) Restart Apache service.
The corresponding php.ini file is loading correclty (see print below)
I tryed use another old versions of the extension and not worked.
I have many PHP versions installed, i tryed in 5.6 too, and not worked as well.
I have tryed in other machine using PHP 7.2 and not worked, i searched too many and not found a solution, i hope some person can help! Thanks.
References:
Windows 8.1
http://php.net/manual/en/mongodb.installation.windows.php
https://pecl.php.net/package/mongodb
All marked as blue i have tried to install, and all downloads are made Thread Safety x64 (correspondent architecture).

To solve this, need to copy some .dll files from PHP install to Apache install, hope to help someone! Reference

Related

How do I fix "PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb' "

I am trying to install and set up mongodb with a laravel application for the first time. I read that I have to install the extension and libraries but after I do that I get the above error when I try to execute a php command in the terminal.
I am running windows 10 x64 and PHP 7.3.1.
First of all I installed the mongodb from the official mongodb site
I got the latest mongodb dll from https://pecl.php.net/package/mongodb/1.6.0/windows
I extracted the dll into the c:/xampp/php/ext folder according to the instructions and restarted the server.
I also included the extension = php_mongodb.dll in the php.ini file
This is what I get...
I found a similar post on here PHP unable to load dynamic library (mongo.so) that could have solved my problem but that solution is for users on mac and I am on windows.
I'm answering my own question here. Turns out my xampp version was x86 and so x64 version of the dll would obviously not work... Solution was to just use x86 version of the dll instead.

How to install V8Js for PHP on XAMPP for Windows?

Been working for days now trying to find an easy way to install V8Js on XAMPP for windows, yet with no success.
I have downloaded the latest XAMPP version with PHP version 7.2.0 VC15, and followed the instructions in this blog post - https://blog.xenokore.com/how-to-install-v8js-for-php-on-windows/ - but to no avail. I don't see a mention to V8Js in the phpinfo, and when I try to use it I get an ERROR
Error: Class 'V8Js' not found in...
I have downloaded the dll files from here - https://blog.xenokore.com/how-to-install-v8js-for-php-on-windows/ - and used the latest 7.2.1 VC15 x86 ts version with no success.
Can anyone offer some help?
You need to download lasted php version from here instead https://www.apachelounge.com/viewtopic.php?t=6359
Then move a php_v8js.dll from php\ext into same directory on your local.
But with 5 files additional from root directory of php have to move into your apache\bin instead
icui18n.dll
icuuc.dll
v8.dll
v8_libbase.dll
v8_libplatform.dll
Be sure to have it in your php.ini, by adding the following line:
extension=php_v8js.dll
Then try to restart apache or check by command php -m, have fun.

PHP 5.4 and MsSQL on XAMPP [duplicate]

This question already has answers here:
How do I get the SQLSRV extension to work with PHP, since MSSQL is deprecated?
(3 answers)
Closed 3 years ago.
I'm trying to run mssql driver for PHP, but something goes wrong.
I managed to get the right drivers for mssql, then added the extensions in php.ini, but PHP is still running "--without-mssql" "--without-pdo-mssql".
I'm running PHP 5.4 under Apache 2.2 on Windows XP SP3.
How to start the mssql drivers?
I've just had the same problem, for me I needed to use a different version of the driver.
I was using:
extension=php_sqlsrv_53_ts.dll
Which gave me the following error in PHP:
[28-Nov-2013 10:58:47 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API
The solution:
extension=php_sqlsrv_54_ts.dll
Download from: http://www.microsoft.com/en-us/download/details.aspx?id=20098
See this answer: https://stackoverflow.com/a/25199324/1847383. If you use PHP as an Apache module, use the thread safe version.
I have found a great tutorial and explanation on this website:
http://bendustries.co/wp/setting-up-xampp-to-work-with-mssql/
All you need to do is download from here :
https://www.microsoft.com/en-us/download/details.aspx?id=20098
two files called:
php_pdo_sqlsrv.dll
php_pdo_sqlsrv.dll
And place then inside the php\ext folder.
Then you need to add those two lines under "Dynamic Extensions"
extension=php_sqlsrv.dll
extension=php_pdo_sqlsrv.dll
Save your php.ini file and restart apache, This process worked for me on win7 after I tried several other methods !

step-by-step instructions for installing IMAGEMAGICK on WAMP?

There don't seem to be any concise tutorials/walk throughs for installing ImageMagick on WAMP for use with PHP.
I've tried dozens of combinations of their binary releases with different php extension dll files. I can get imagemagick working fine from the command line, and I can get it to show as ticked in the WAMP extensions, but can't actually use it.
Has anyone come across a good guide for installing this ball ache piece of software?
I've followed http://www.knowledge-transfers.com/it/installing-imagemagick-on-windows-setup-imagick-on-php with no luck...
Update: this is what happens when I follow the steps in PHP farmer's answer on windows7. My php.ini is setup as follows:
extension_dir = "c:/wamp/bin/php/php5.3.0/ext/"
extension=php_imagick.dll
I reboot and get these two errors in this order
and here is the dll file where it should be:
I know this is old post but I spend my all day to make it work, so here are the steps that helped me:
Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
Install in C:\imagemagick, on last step check "Add application directory to your system path"
Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
Copy php_imagick.dll to C:\wamp\bin\php\ext
Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
Restart Wamp server and check phpinfo() for imagick plugin
If last step does not work, restart Windows
I have improved fsasvari answer to cater general scenarios and versions. All credits to him.
Install Imagick in WAMP
Open your phpinfo() page
Check the below
PHP version (mine : 5.5.12)
Compiler (mine : MSVC11 (Visual C++ 2012) )
Architecture : (mine : x64)
Thread Safety : enabled
Loaded Configuration File (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
extension_dir : (mine : c:/wamp/bin/php/php5.5.12/ext/)
Apache Bin (Not in phpinfo() page) : C:\wamp\bin\apache\apache2.4.9\bin\
Get the latest release match to your architecture from here (for me it was ImageMagick-x86_64-pc-windows.exe).
Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
Install in C:\imagemagick, on last step check "Add application directory to your system path"
Download the PECL matching to your architecture
http://pecl.php.net/package/imagick/3.1.2/windows
(for me : 5.5 Thread Safe (TS) x64)
Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)
Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)
Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
add extension=php_imagick.dll line in extensions section
Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
Restart Wamp server and check phpinfo() for imagick plugin
If last step does not work, restart Windows (Specially if you have previously installed imagemagick in different folder/version)
For WAMPSERVER 3.1.9 64bit, PHP Version: 7.3.5
I had a lot of trouble with this as well and some things I did wrong was that I doubted ImageMagick would load on my new php version. But you have to believe it will work and don't try with older php versions :)
So this was my approach, remember to follow it with your own settings and versions/folders.
Before you start, make sure you running the php version you want to run. If you installed Wampserver 3, you may click the wamp icon and go to php version and activate the one you want to run.
1
Get latest ImageMagick version for your system here: http://ftp.icm.edu.pl/packages/ImageMagick/binaries/
(I got the ImageMagick-x86_64-pc-windows.exe in the bottom)
2
Install ImageMagick in C:/imagemagick (I put it in lower cases),
You will be asked for some stuff during install, just make sure the path thingy is ticked.
You should also tick the convert thingy if it allows you.
Then after install you can run CMD and type convert -version to see if imagick is installed.
3
Run <?php phpinfo(); ?> And find out these settings:
PHP Version: 7.3.5
System: Windows
Compiler: MSVC15 (Visual C++ 2017) ([VC15])
Architecture: x64 (or maybe you have x86)
Thread Safety: enabled ([TS] else [NTS])
You probably have other settings, but you need to remember yours to download the proper php_imagick.dll
4
Get the php_imagick.dll you want for your php version from here: http://pecl.php.net/package/imagick
I got mine from here: http://pecl.php.net/package/imagick/3.4.4/windows for php 7.3
Remember your info from the phpinfo(), it has to match, else it won't work.
5
After you unzip it, copy the php_imagick.dll and paste it in C:/wamp64/bin/php/php7.3.5/ext/
Then copy all the other .dll files from that folder into C:/wamp64/bin/apache/apache2.4.39/bin/
Yes it's dirty but you will get it working like this.
6
Add extension=php_imagick.dll in C:/wamp64/bin/php/php7.3.5/phpForApache.ini
I added it after the other extensions in the file.
7
Restart all Wamp services.
If you been messing around earlier with installs, you might have to restart the computer due to some weird cache stuff.
8
Check phpinfo() again if imagick shows up and try something like $im = new Imagick();
9
Click the Wamp icon -> php -> extensions, php_imagick should be listed.
Good luck! :)
PHP 5.4 php_imagick.dll is here: http://www.peewit.fr/imagick/ .
I read somewhere that 64bit php doesnt work with php_imagick. That might be the case when you get this error in apache_error.log
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
%1 is not a valid Win32 application.\r\n in Unknown on line 0
As mentioned above, it was also necessary to add this into httpd.conf (also, i read you cant have spaces/dashes/dots):
SetEnv MAGICK_HOME C:/imagemagick"
If you dont, you might get this error:
"PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
The specified procedure could not be found. in Unknown on line 0"
In the end, this article might partially help: http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/
This was a headache for me as well, but unfortunately I installed this quite awhile ago. The instructions from that link you posted seem accurate. Have you ran phpinfo(); to see if it is installed in the Apache Environment? It should be listed as MAGICK_HOME.
Make sure "SetEnv MAGICK_HOME C:/imagemagick" is set at the end of your httpd.conf file. Assuming imagemagick is installed in that directory.
Be sure that you have the extension "php_imagick.dll" in your php.ini file as well.
It should work just fine if you have all those set.
On another note, here is a nice little library someone built to make imagick easier to use. https://github.com/francodacosta/phmagick
I hope that helps! Good luck!
I've never used WAMP but I have found that sometimes installing PHP extensions on Windows I need to ensure that any dll's that the extension relies on is in the Windows system PATH. If there is more than the one dll packaged with the imagemagick extension, try adding the directory that the dll's reside in to the Windows system PATH then REBOOT (to ensure that the web server gets a copy of the NEW environment).
I know this is an old question but i guess this will help someone someday out there....
If you are on WAMPP and have PHP 5.4.x installed , go here http://www.peewit.fr/imagick/
and download appropriate files as instructed. It will work.
Please see this answer already on StackOverflow:
Installing ImageMagick extension with php/windows
I answered this question some time ago. This solves the DLL mismatch error.

How do I enable the PHP HTTP PECL extension on Windows?

I have an installation of XAMPP version 1.7.3 on Windows 7 x64. I want to enable the PHP HTTP extension. How do I go about doing so? That is, where to I get the DLL, register it, etc. Thanks in advance.
First, download the PECL module from the php website.
Then unzipp it and copy the file php_http.dll in your PHP extension folder. Then edit your php.ini file (c:\WINDOWS\php.ini) and activate the module :
extension=php_http.dll
As you are on an earlier PHP Version, you can get the build from: http://downloads.php.net/pierre/
If you upgrade to XAMPP 1.8.3, which uses PHP 5.4, then you should take a look at the closed bug about this found at: bugs.php.net/bug.php?id=62056
As per details in the bug comments; I downloaded the ts (thread safe) version for XAMPP 1.8.3 from github.com/stealth35/stealth35.github.com/downloads and listed as "php_http-1.7.4 -5.4-vc9-x86.zip"
The latest builds can be found at: windows.php.net/downloads/pecl/releases/http/1.7.5/
Amoung those links you should find a version specifically for what you need.

Categories