title: How to add PHP extension in Windows 10?
body: <p>I have downloaded PHP build from <a href="https://chocolatey.org/packages/php" rel="nofollow noreferrer">Chocolatey</a> on my Windows 10 PC. I have attempted to install and activate the <a href="https://windows.php.net/downloads/pecl/releases/redis/5.3.2/php_redis-5.3.2-7.4-ts-vc15-x64.zip" rel="nofollow noreferrer">PHP Redis</a> extension, so I downloaded the archive, copied the <code>php_redis.dll</code> extension file to the default <code>ext</code> folder and modified the <code>php.ini</code> file like so:</p>
  <pre><code>;;;;;;;;;;;;;;;;;;;;;;
  ; 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=&lt;ext&gt;.so' and
  ; 'extension='php_&lt;ext&gt;.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=&lt;ext&gt;) 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=curl
  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
  
  ; Added by Rumon:
  extension=mongodb
  extension=redis
  </code></pre>
  <p>Followed this same path to install <code>mongodb</code> extension as well (Downloaded from <a href="https://windows.php.net/downloads/pecl/releases/mongodb/1.8.1/php_mongodb-1.8.1-7.4-ts-vc15-x64.zip" rel="nofollow noreferrer">here</a>).</p>
  <p>Now, when I do anything related to those drivers, I get error that the system cannot find the extensions. For example:</p>
  <pre class="lang-sh prettyprint-override"><code>$ php --ini
  PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb' (tried: ext\mongodb (The specified module could not be found.), ext\php_mongodb.dll (The specified module could not be found.)) in Unknown on line 0
  PHP Warning:  PHP Startup: Unable to load dynamic library 'redis' (tried: ext\redis (The specified module could not be found.), ext\php_redis.dll (The specified module could not be found.)) in Unknown on line 0
  Configuration File (php.ini) Path:
  Loaded Configuration File:         C:\tools\php74\php.ini
  Scan for additional .ini files in: (none)
  Additional .ini files parsed:      (none)
  </code></pre>
  <p>For everybody's convenience, I am providing a SS of the extensions directory, <a href="https://prnt.sc/vbsm1o" rel="nofollow noreferrer">have a look</a>.</p>
  <p>Can anyone explain what's causing the issue? And how can I resolve this?</p>