Reputation: 178
I try to load few extensions from php.ini
file, and for some reason, these extensions does not load, even when I point to their folder directly. I tried to find a solution all over the internet but this weird problem does not have any solution.
Extensions part on my php.ini
file:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
;extension_dir = "ext"
extension_dir = "f:/namp/bin/php/7.4.6-ts/ext"
[...] php stuff here [...]
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename
;
; For example:
;
; extension=mysqli
;
; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
; extension=/path/to/extension/mysqli.so
;
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.
;
; Notes for Windows environments :
;
; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
;
;extension=bz2
extension="f:/namp/bin/php/7.4.6-ts/ext/php_curl.dll"
;extension=ffi
;extension=ftp
extension=fileinfo
extension=gd2
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
extension=mbstring
;extension=exif ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;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
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=snmp
;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
extension=xmlrpc
;extension=xsl
A PHP script which I run to check for loaded extensions (http://localhost/test.php
):
foreach (['mbstring', 'gd2', 'fileinfo', 'curl', 'mysqli', 'pdo_mysql', 'xmlrpc']
as $extension) {
$loaded = extension_loaded($extension) ? 'Loaded' : 'Not Loaded';
echo "{$extension}: {$loaded}<br>";
}
result:
mbstring: Loaded
gd2: Not Loaded
fileinfo: Loaded
curl: Not Loaded
mysqli: Loaded
pdo_mysql: Loaded
xmlrpc: Loaded
How can I solve this?
I am using PHP.ini file created of php.ini-production
on Windows 10 x64. PHP TS x64 for Apache
UPDATE: php -m
returns:
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
pcre
PDO
pdo_mysql
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib
[Zend Modules]
I've downloaded the latest version from here
Upvotes: 0
Views: 2620
Reputation: 178
Solution:
Uncomment the extension (can be with full path and can be also just extension=curl
), and copy the file libssh2.dll
from PHP's directory to Apache's bin directory (e.g.: `Apache24/bin/)
Thanks to @armyofda12mnkeys here
Upvotes: 1