How to install YAML extension to PHP 7.4? - php

I'm trying to install YAML extension to PHP 7.4.4 on Windows.
Steps I've taken:
Downloaded the latest DLL package from https://pecl.php.net/package/yaml (currently 2.1.1) for 7.4 Non Thread Safe (NTS) x64.
Copied php_yaml.dll to the extension folder C:/my_path/bin/php/php-7.4.4-Win32-vc15-x64/ext
Added extension=yaml to php.ini.
At this point, all tutorials I've found instruct to copy yaml.dll to a bin folder, but there is no such file in the current YAML package.
When I run PHP now, it gives me the following error:
Warning: PHP Startup: Unable to load dynamic library 'yaml' (tried: C:/my_path/bin/php/php-7.4.4-Win32-vc15-x64/ext\yaml (The specified module could not be found.), C:/my_path/bin/php/php-7.4.4-Win32-vc15-x64/ext\php_yaml.dll (The specified module could not be found.)) in Unknown on line 0
What else do I need to do to get YAML to work in PHP?

Related

(Windows) PHP ZeroMQ Binding Installation XAMPP Error

I have PHP 8 installed and have put all the dll to their respective paths
php_zmq.dll file in C:\xampp\php\ext
libzmq.dll file in C:\xampp\php
And I also added the extension=php_zmq.dll in php.ini, but still got the error in php cli
PHP Warning: PHP Startup: Unable to load dynamic library
'php_zmq.dll' (tried: C:\xampp\php\ext\php_zmq.dll (%1 is not a valid
Win32 application), C:\xampp\php\ext\php_php_zmq.dll.dll (The
specified module could not be found)) in Unknown on line 0
Do you have any idea how to fix this ?,
Is there any stable version for PHP Binding ZeroMQ

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

PHP extension is not recognised on Windows (using PHP 7.4)

I need the Event library for my project in PHP. The main project is running on a raspberry pi but I'm writing and testing the code completely on my Windows PC. To run the PHP code, I use the XAMPP.
I tried to import the Event extension within my code but in the command window, I keep getting the same error:
D:\xamd server\php>php.exe -i
PHP Warning: PHP Startup: Unable to load dynamic library 'event' (tried: D:\xamd server\php\ext\event (The specified module could not be found.), D:\xamd server\php\ext\php_event.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'event' (tried: D:\xamd server\php\ext\event (The specified module could not be found.), D:\xamd server\php\ext\php_event.dll (The specified module could not be found.)) in Unknown on line 0
phpinfo()
PHP Version => 7.4.12
This error is weird in my opinion since the file which it can't fine on this link, should be there:
I also added this file in some different folders such as system32 and apache\bin but none of this helps.
I downloaded the extension: "7.4 Thread Safe (TS) x64" from: https://pecl.php.net/package/event/3.0.7RC1/windows which should be the correct one for my PHP version.
And I also edited the php.ini file to add this extension to the library.
I'm probably forgetting one step but I have no idea what.
Would be great if someone could help me with this one.
The same error is displayed if the extension DLL was compiled for a different version of PHP.
Using Windows Explorer, right-click on the DLL and select properties, then Details. Check the Product version value.
The actual issue is that PHP extensions have an API version such as 20200930. The API version must match PHP and the extension. The CLI command php -i | grep API will display this information.

MongoDB driver extension (php_mongodb.dll)) not found by PHP v7.2.5

I'm trying to add MongoDB extension to the PHP and use it with Laravel 5.6.
I know that I should download the dll file from PECL and copy it in the ext folder inside PHP and add extension=php_mongodb.dll to my php.ini file. But I face this warning when I do like what I said:
Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll'
(tried: C:\php\ext\php_mongodb.dll (The specified module could not be
found.), C:\php\ext\php_php_mongodb.dll.dll (The specified module
could not be found.)) in Unknown on line 0
I'm a windows 10 user and my PHP version is 7.2.5.
Is it effect on MongoDB usage or It's ignorable and I can overtake it?
Update:
I also tested extension=php_mongodb.dll like extension=php_mongodb, extension=mongodb.dll, extension=php_mongodb.dll and extension=mongodb too.
And I copied the php_mongodb.dll to the C:\php\ext\php_mongodb.dll.

yaml xampp warning: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll'

I installed the recent versions of xampp for windows and yaml on my PC with windows 8.1 64bit.
The versions were
xampp-win32-7.0.9-1-VC14-installer.exe
php_yaml-2.0.0rc8-7.0-ts-vc14-x86.zip
I put the line of extension=php_yaml.dll to the end of php.ini file.
I copied php_yaml.dll to C:/xampp/php/ext folder.
I copied yaml.dll to C:/xampp/apache/bin folder.
phpinfo(); command displayed that yaml was enabled.
But bad warning still appeared on command prompt when typing php command:
$ php
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll' - The spec
ified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll' - The specified
module could not be found.
in Unknown on line 0
See it on screenshots:
How to fix it?
Add ;C:\xampp\apache\bin to PATH Windows environment variable.
I fixed mine by downloading the correct version of yaml. The yaml Version has to match the installed PHP version. Make sure that you match the thread-safe and non-thread-safe option with your PHP aswell.
How to check if your PHP is thread-safe

Categories