简体   繁体   中英

PHP 7.4.* doesn't find extensions

I switched from PHP 7.3.15 to PHP 7.4.3 on my development machine more or less using the exact same php.ini file. In that php.ini file, I only changed the value of extension_dir to the new path. But PHP 7.4.3 didn't find any extensions.

I created a new, simple, php.ini file to check if it depends on the the extension itself, but it doesn't. I tried PHP 7.3.5, where that simplified php.ini worked. I tried PHP 7.4.0 and it didn't work.

I'm using wamp with Apache 2.4.4 on a Windows 10 Pro machine.

Here's the link to that simplified PHP 7.4.0 php.ini: https://www.graphity-consulting.com/tests/php-error.ini

Here are the error messages when starting Apache:

[16-Mar-2020 09:50:34 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: d:\opt\wamp\bin\php\php7.4.0\ext\curl (Das angegebene Modul wurde nicht gefunden.), d:\opt\wamp\bin\php\php7.4.0\ext\php_curl.dll (Das angegebene Modul wurde nicht gefunden.)) in Unknown on line 0
[16-Mar-2020 09:50:35 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: d:\opt\wamp\bin\php\php7.4.0\ext\curl (Das angegebene Modul wurde nicht gefunden.), d:\opt\wamp\bin\php\php7.4.0\ext\php_curl.dll (Das angegebene Modul wurde nicht gefunden.)) in Unknown on line 0

This is a screenshot of my extensions directory: 在此处输入图片说明

What am I doing wrong?

You can fix direct path to extionsion by directive ;extension_dir = "./" ; On windows: ;extension_dir = "ext" extension_dir ="D:/wamp64/bin/php/php7.4.12/ext/" ; It's work on my machine.

I had the same scenario (PHP upgrade) with the same error messages in the Apache log.

It can be solved by either copying the DLL files from the PHP root folder to the Apache bin folder, or by just adding the PHP root folder to your PATH environment variable (whatever floats your boat).

Restart Apache afterwards.

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