PHP extensions not loading - can't install Composer (Windows 10)

Associate
Joined
6 Aug 2013
Posts
312
Hi All,

Thanks for reading - primarily a front end dev, but am starting to dabble in a little PHP at work so thought I'd get myself set up with a local environment at home. Have downloaded and installed PHP 7.1.7, and if I run
Code:
php -v
in Git Bash, it shows:
Code:
PHP 7.1.7 (cli) (built: Jul  6 2017 16:51:33) ( NTS MSVC14 (Visual C++ 2015) x64
 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

PHP.ini has been modified like so to enable extensions:

Code:
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_ftp.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll

;extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

The PHP path is correct, the extension .dll files are in my C:/php/ext folder, but I get this error when I try to install composer - both via the ComposerSetup.exe and by CLI through Git Bash:

Code:
The openssl extension is missing from the PHP version you specified. This means that secure HTTPS transfers are not possible.

The recommended option is to enable the extension in your php.ini, then click Back and try again.

What on earth is going on - why can't it find my modules?
 
PHP cli may be loading a different ini file.
Try running php --ini from the command line to see if it's the one you're expecting.
 
As mentioned above, there are two configs for php. One is for the standard web module, another is for the CLI.

Go to /etc/php/cli and edit that php.ini

Also don't enable caching on your dev box, but definitely turn it on for production if you get there (lightning fast).
 
Sorted - thanks Planty!

Will deffo look into caching when the time comes, but for now I'm just messing around building some little personal projects running locally.

Again, thanks all for your help :).
 
Back
Top Bottom