Solution:
I conceived "php.ini-production" is a dummy configuration file suitable for live environments. Do a php -i
at the console and trace the 'php.ini' path, to view where it is expecting the ini file to be kept. This is generally expecting "php.ini", and may not really exist - in case it does not, copy php.ini-development (or same) to the location requisite.
This is near the top of (a very long) output, hence you may trace redirecting it to a file useful
php -i > C:\phpinfo.txt).
You will further require to uncomment the extension dir. For example, trace this line in your php.ini file:
;extension_dir = "ext"
Remove the semi-colon in front and save the file. I am certain this will perform.
Remember to open your php.ini Administrator mode
After altering anything in php.ini you have to restart your server, ensure that you did so first of all.
in WAMPserver edit this files:
D:\wamp\bin\php\php5.3.10\php.ini
or
D:\wamp\bin\php\php5.4.12\php.ini (based on version)
Do not employ the php.ini in the WAMP server menu. It will not perform. Go to the origin of your wamp and as definited above with D as root.
Create a php.ini
(for example from php.ini-production
), open it in an editor as admin (!), remove the commenting semicolon ;
in front of extension=php_openssl.dll
, set the extension_dir
accurately, and save the file. After that it must be performing. However once again: open and edit the php.ini
as admin.
In case you are employing MAMP on Windows, you require to alter the extension for php.ini-development
to php.ini
. After that, paste this line ;extension_dir = "ext"
into the php.ini file, prior the first extension appear, and uncomment this other line ;extension=php_openssl.dll
removing the prefixed semicolon. Remember to restart apache
The similar error happened to me. I solved it by turning off TLS for Composer, it's not safe however I considered the risk on my develop machine.
Attempt this:
composer config -g -- disable-tls true
and re-run your Composer. It performs to me.
However it's not secure and not recommended for your Server. The official website says:
In case set to true all HTTPS URLs will be attempted with HTTP instead and no network-level encryption is worked. Enabling this is a security risk and is NOT recommended. The better method is to enable the php_openssl extension in php.ini.
In case you don't want to enable unsecure layer in your machine/server, so setup your php to enable openssl and it also performed. Ensure that the PHP Openssl extension has been installed and enable it on php.ini file.
To enable OpenSSL, add or trace and uncomment this line on your php.ini file:
Linux/OSx:
extension=php_openssl.so
Windows:
extension=php_openssl.dll
And reload your php-fpm / web-server in case reqired
For the composer reference there are two relevant options: disable-tls
and secure-http
.
nano ~/.composer/config.json ...
{
"config": {
"disable-tls": true,
"secure-http": false
}
}
Thereafter it complains much:
You are running Composer with SSL/TLS protection disabled.
Warning: Accessing getcomposer.org over http which is an insecure protocol.
However, it works the composer selfupdate
(or whatever).
while one cannot easily "enable SSL in the php.ini" on Linux; PHP requires to be compiled with openSSL configured as shared
library - in order to be able to access it from the PHP CLI SAPI.
Hence, after inventioning and looking for a while I found that my PHP.INI obviously didn't look in the accurate directory for my PHP Extensions, so I went under:
"Directory in which the loadable extensions (modules) reside." And casting the following:
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
;extension_dir = "ext"
And easily removed the ; infront of "extension_dir = "ext", note this is just for Windows, remove the semicolon in front of the first extension_dir in case you are running a different operating system.