Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting warning for curl extension in php8.4 #16942

Closed
adeshmrane opened this issue Nov 26, 2024 · 8 comments
Closed

getting warning for curl extension in php8.4 #16942

adeshmrane opened this issue Nov 26, 2024 · 8 comments

Comments

@adeshmrane
Copy link

Description

PHP Warning: PHP Startup: Unable to load dynamic library 'php_curl.dll' (tried: C:/Program Files/Ampps\php84\ext\php_curl.dll (The specified procedure could not be found), C:/Program Files/Ampps\php84\ext\php_php_curl.dll.dll (The specified module could not be found)) in Unknown on line 0

I am getting the above error when I am using the Windows binary provided on your site.

PHP Version

php 8.4.1

Operating System

windows 10

@cmb69
Copy link
Member

cmb69 commented Nov 26, 2024

I assume that some php_curl.dll dependencies are not in the PATH. This is possibly about libssh2.dll which needs to be version 1.11.1 (or 1.11), but not 10.0.0 or even older. See also #16794.

If a recent libssh2.dll is in the path, use deplister.exe (contained in the downloads from window.php.net) to check further dependencies (deplister php_curl.dll). Also make sure that you are using a recent Microsoft Visual C++ redistributable.

@adeshmrane
Copy link
Author

Hi,

The folder contains libssh2.dll of version 1.11.1.

tried with deplister.exe and got the output below.
C:\Users\Yash>E:\Ampps\php84\deplister.exe E:\Ampps\php84\ext\php_curl.dll
php8ts.dll,OK
libcrypto-3-x64.dll,OK
libssl-3-x64.dll,OK
CRYPT32.dll,OK
WLDAP32.dll,OK
Normaliz.dll,OK
libssh2.dll,OK
nghttp2.dll,OK
KERNEL32.dll,OK
ADVAPI32.dll,OK
WS2_32.dll,OK
VCRUNTIME140.dll,OK
api-ms-win-crt-heap-l1-1-0.dll,NOTFOUND
api-ms-win-crt-stdio-l1-1-0.dll,NOTFOUND
api-ms-win-crt-string-l1-1-0.dll,NOTFOUND
api-ms-win-crt-runtime-l1-1-0.dll,NOTFOUND
api-ms-win-crt-convert-l1-1-0.dll,NOTFOUND
api-ms-win-crt-filesystem-l1-1-0.dll,NOTFOUND
api-ms-win-crt-utility-l1-1-0.dll,NOTFOUND
api-ms-win-crt-time-l1-1-0.dll,NOTFOUND
api-ms-win-crt-math-l1-1-0.dll,NOTFOUND

i have Latest Microsoft Visual C++ Redistributable Version installed
installed both x64 and x86 version too

@cmb69
Copy link
Member

cmb69 commented Nov 27, 2024

PHP Warning: PHP Startup: Unable to load dynamic library 'php_curl.dll' (tried: C:/Program Files/Ampps\php84\ext\php_curl.dll (The specified procedure could not be found)

C:\Users\Yash>E:\Ampps\php84\deplister.exe E:\Ampps\php84\ext\php_curl.dll

These are different paths. Is it possible that Apache picks up the wrong php.ini, or that you have not configured extension_dir correctly?

@adeshmrane
Copy link
Author

Other extensions from that same extension_dir are loading properly

@cmb69
Copy link
Member

cmb69 commented Nov 27, 2024

Okay, but then checking E:\Ampps\php84\ext\php_curl.dll is useless. Anyhow, using deplister.exe from the console isn't verifying the real thing. You need to put deplister.exe into the folder where httpd.exe is (possibly C:\Program Files\Ampps\apache\bin), and then to set up a small script in the doc root:

<?php

$apache_bin = "C:\\Program Files\\Ampps\\apache\\bin"; // may need to change this
$extension_dir = ini_get("extension_dir");
passthru("\"$apache_bin\\deplister.exe \" \"$extension_dir\\php_curl.dll\"");

Then request this document, and see whether all DLLs are OK. If any are NOTFOUND, this needs to figured out first.

@adeshmrane
Copy link
Author

after running the script given I am getting

php8ts.dll,OK libcrypto-3-x64.dll,OK libssl-3-x64.dll,OK CRYPT32.dll,OK WLDAP32.dll,OK Normaliz.dll,OK libssh2.dll,OK nghttp2.dll,OK KERNEL32.dll,OK ADVAPI32.dll,OK WS2_32.dll,OK VCRUNTIME140.dll,OK api-ms-win-crt-heap-l1-1-0.dll,NOTFOUND api-ms-win-crt-stdio-l1-1-0.dll,NOTFOUND api-ms-win-crt-string-l1-1-0.dll,NOTFOUND api-ms-win-crt-runtime-l1-1-0.dll,NOTFOUND api-ms-win-crt-convert-l1-1-0.dll,NOTFOUND api-ms-win-crt-filesystem-l1-1-0.dll,NOTFOUND api-ms-win-crt-utility-l1-1-0.dll,NOTFOUND api-ms-win-crt-time-l1-1-0.dll,NOTFOUND api-ms-win-crt-math-l1-1-0.dll,NOTFOUND

image

@cmb69
Copy link
Member

cmb69 commented Nov 27, 2024

So basically the same as when running from the command line. These DLLs are part of the UCRT (universal C runtime), and should be installed on any Windows 10 system). See https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment for details. I have no idea why these DLLs are apparently missing on your system. They are required for PHP on Windows for a very long time.

But then you say that other extensions and apache2handler would load fine, but these also depend on these DLLs. So I'm back to guessing what the actual problem is. Perhaps it's about nghttp2.dll; PHP 8.4.1 ships with version 1.63.0.0, but Apache might have an older nghttp2.dll in the bin\ folder. Maybe replace that with that shipped with PHP and try again (keep a backup of the old one in case that breaks other stuff).

@adeshmrane
Copy link
Author

Hi @cmb69 ,

Thanks for your valuable time.

I found that the libssh2.dll file in the Apache bin folder is of an older version causing this.
php84 folder contains the latest one but the Apache bin folder has an older one.

copying libssh2.dll from php84 to the Apache bin folder solved the issue for me.

Thanks again for your time.

@cmb69 cmb69 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants