Can't Get Curl Enabled in PHP 7.3.9 - php

I keep getting this error when I try to run cUrl:
Call to undefined function curl_init()
So I try to install it with these lines:
extension_dir = "C:\PHP7\ext"
extension=curl
But it never shows up in my phpinfo();
Here is from the Apache error log:
PHP Startup: Unable to load dynamic library 'curl' (tried: C:\\PHP7\\ext\\curl (The specified module could not be found.), C:\\PHP7\\ext\\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0
And I've also tried the absolute path to curl (extension=C:\PHP7\ext\php_curl.dll)

If:
Your settings look correct.
You're trying to load the right DLL for your PHP installation and not e.g. some random one you found in Google).
Curl works just fine from command-line PHP.
But you get this when running PHP as Apache module:
PHP Startup: Unable to load dynamic library 'curl' (tried: C:\...\ext\curl (The specified module could not be found.), C:\...\ext\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0
Then there's a chance that it gets fixed if you upgrade Apache to the latest build. (I've had that same problem myself.)

That was my problem too. I decided to upgrade my apache to Apache version 2.4.41
Link to binary if you install manually: https://www.apachelounge.com/download/
My php version is 7.3.9
good luck

Related

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.

PHP Startup: Unable to load dynamic library 'http' - Windows 10

I am running PHP 8.0.3 on my windows 10 machine and trying to enable HTTP extension. I have downloaded the HTTP package from PECL HTTP. When I try to start PHP I get the below error.
PHP Warning: PHP Startup: Unable to load dynamic library 'http' (tried: C:\Php8.0.3\ext\http (The specified module could not be found), C:\Php8.0.3\ext\php_http.dll (The specified module could not be found)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'http' (tried: C:\Php8.0.3\ext\http (The specified module could not be found), C:\Php8.0.3\ext\php_http.dll (The specified module could not be found)) in Unknown on line 0
Not sure what I'm doing wrong here. Any help will be appreciated.
I did figure it out. Windows error was very unhelpful and only found this out after digging through some documentation.
The http extensions relies on the raphf extension, which I didn't have installed. On Linux, it would alert me to that, but on windows it just throws a generic "couldn't find extension". Probably the same thing for yourself.
One of a few things is happening:
The file doesn't exist in the filepath it's being looked for in. Check the location in the error message or
The file exists, but it's permissions are wrong.
Hint, it's the former ;)

Warning: PHP Startup: Unable to load dynamic library 'openssl'

I have xampp installed on my Windows 10 machine. Running php from command prompt gives error as below.
Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: D:\xamp\php\ext\openssl
(The specified module could not be found.), D:\xamp\php\ext\php_openssl.dll
(The specified module could not be found.)) in Unknown on line 0
In php.ini for extension_dir I tried giving absolute path as well as relative path to extension directory.
File is available in location D:\xamp\php\ext\php_openssl.dll. It still gives the error.
Can you check if the loaded php.ini is the correct one ?
php --ini
also you can check php -m to check the loaded extension in cmd using
php -m | findstr "xml"
also you can try to manually download the openssl extension:
http://www.dlldownloader.com/php_openssl-dll/

I can't get PHP zip extension to work on WAMP

I am using WAMP with PHP 7.2.4. I need to use PHP's ZipArchive, for which I need the zip.so (php_zip.dll) extension.
I've read it is somehow included in PHP's core since 5.6.x (I believe), so I tried to simply add
extension=php.so
or
extension=php_zip.dll
to php.ini file (tried both lines, also tried both php.ini and phpForApache.ini). It didn't work, so I've downloaded php_zip.dll file (5.6 NTS x64) from here: https://pecl.php.net/package/zip/1.12.4/windows , copied it to /wamp64/bin/php7.2.4/ext/ and repeated the process, with the same results.
When I look into PHP error log, this is what I get:
[03-Mar-2020 07:15:04 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: c:/wamp64/bin/php/php7.2.4/ext/zip.so (The specified module could not be found.), c:/wamp64/bin/php/php7.2.4/ext/php_zip.so.dll (The specified module could not be found.)) in Unknown on line 0
[03-Mar-2020 07:15:04 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_zip.dll' (tried: c:/wamp64/bin/php/php7.2.4/ext/php_zip.dll (The specified module could not be found.), c:/wamp64/bin/php/php7.2.4/ext/php_php_zip.dll.dll (The specified module could not be found.)) in Unknown on line 0
I get the first or second line, depending on whether I tried to load php.so, or php_zip.dll extension. Notice the path near the end of those lines: .../ext/php_php_zip.dll.dll. Because of this I also tried to load simply extension=zip, but no luck.
How can I get it to work?

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.

Categories