简体   繁体   中英

PHP 8 NTS/Windows: Unable to load dynamic library 'http' but extension files are surely present

I'm running composer update in a project which has ext-http required in composer.json and getting this error.

PHP Warning:  PHP Startup: Unable to load dynamic library 'http' (tried: 
ext\http (Não foi possível encontrar o módulo especificado), 
ext\php_http.dll (Não foi possível encontrar o módulo especificado)
) in Unknown on line 0

However, I'm positively sure that I have downloaded the extension from https://windows.php.net/downloads/pecl/releases/pecl_http/4.2.1/php_pecl_http-4.2.1-8.0-nts-vs16-x64.zip and saved the files php_http.dll and php_http.pdb in my PHP\ext folder, where all other extensions are.

My PHP version is:

PHP 8.0.7 (cli) (built: Jun 14 2021 19:43:23) ( NTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans

Inside my PHP.ini, it is already among the loaded extensions:

extension=amqp
extension=bz2
extension=curl
extension=ffi
extension=ftp
extension=fileinfo
extension=gd
;extension=gettext
;extension=gmp
extension=http    ;  <=== here
extension=intl
;extension=imap
;extension=ldap
extension=mbstring
;extension=exif
;extension=mysqli
;extension=oci8_12c
;extension=oci8_19
;extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=shmop
;extension=snmp
extension=soap
extension=sockets
extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xsl
zend_extension=opcache

What's the problem I'm failing to see?

The module php_http depends on php_raphf. You can download the missing module here:

https://pecl.php.net/package/raphf

Then add extension=raphf just before extension=http in your php.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM