Can't install php Composer, complaining about openssl - composer-php

I'm trying to install Composer. However, it's giving me an error about "...openssl extension is missing..." (please see screenshot)
In my wampserver configuration I've enabled openssl extension (please see screenshot)
Please advice.

The composer download, as far as I remember, uses the PHP CLI (Command Line Interface) so in fact you have to include the php_openssl module into the PHP.INI used by the PHP CLI.
So edit the php.ini in the \wamp\bin\php\phpx.y.z folder. You have to do this manually you cannot use the menu liks on wampmanager.
Just remove the comment # from column 1 of this line
#extension=php_openssl.dll

Related

how to solve "you are running Composer with SSL/TLS protection disabled"? in Laravel [duplicate]

composer create-project flarum/flarum . --stability=beta
I try to run this command, but it gave me this error.
[RuntimeException]
The openssl extension is required for SSL/TLS protection but is not availab
le. If you can not enable the openssl extension, you can disable this error
, at your own risk, by setting the 'disable-tls' option to true.
I tried to add "extension=php_openssl.dll" to "php.ini", but it still got this error
The same error occurred to me. I fixed it by turning off TLS for Composer, it's not safe but I assumed the risk on my develop machine.
try this:
composer config -g -- disable-tls true
and re-run your Composer. It works to me!
But it's unsecure and not recommended for your Server. The official website says:
If set to true all HTTPS URLs will be tried with HTTP instead and no network-level encryption is performed. Enabling this is a security risk and is NOT recommended. The better way is to enable the php_openssl extension in php.ini.
If you don't want to enable unsecure layer in your machine/server, then setup your php to enable openssl and it also works. Make sure the PHP Openssl extension has been installed and enable it on php.ini file.
To enable OpenSSL, add or find 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 if needed!
UPDATE:
As of PHP 7.4 the extension is named extension=openssl (known for Windows).
This issue occurs due to openssl and extension directory so uncomment below extensions in php.ini file
extension=php_openssl.dll
extension_dir = "ext"
Its works on my machine.
I had the exact same problem and couldn't find a solution, so after thinking and looking for a while I figured that my PHP.INI apparently didn't look in the correct directory for my PHP Extensions, so I went under:
"Directory in which the loadable extensions (modules) reside."
And found the following:
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
;extension_dir = "ext"
And simply removed the ; infront of "extension_dir = "ext", note this is only for Windows, remove the semicolon in front of the first extension_dir if you are running a different operating system.
I have no idea why mine wasn't already unmarked, but it's just something to look for if you are having problems.
According to the composer reference there are two relevant options: disable-tls and secure-http, which one can use. Just edit the configuration with: nano ~/.composer/config.json:
{
"config": {
"disable-tls": true,
"secure-http": false
}
}
Then it will complain about:
You are running Composer with SSL/TLS protection disabled.
Warning: Accessing getcomposer.org over http which is an insecure protocol.
But it performs the composer selfupdate (or whatever command).
One cannot simply "enable SSL in the php.ini" on Linux; PHP needs to be compiled with openSSL configured as shared library - in order to be able to access it from the PHP CLI SAPI.
To enable openssl go into php.ini and enable this line:
extension=php_openssl.dll
if you don't want enable openssl you can set to composer not use openssl with this command:
composer config -g -- disable-tls true
however, this is a security problem.
After trying everything, I finally managed to get this sorted. None of the above suggested solutions worked for me. My system is A PC Windows 10. In order to get this sorted I had to change the config.json file located here C:\Users\[Your User]\AppData\Roaming\Composer\. In there, you will find:
{
"config": {
"disable-tls": true},
"repositories": {
"packagist": {
"type": "composer",
"url": "http://repo.packagist.org" // this needs to change to 'https'
}
}
}
where you need to update the packagist repo url to point to the 'https' url version.
I am aware that the above selected solution will work for 95% of the cases, but as I said, that did not work for me. Hope this helps someone.
Happy coding!
I had the same problem. I tried everything listed on this page. When I re-installed Composer it worked like before. I had a PHP version mismatch that was corrected with a new install establishing the dependencies with the PHP path installed in my system environment variables.
I DO NOT RECOMMEND the composer config -g -- disable-tls true approach.
By the way the way to reverse this is composer config -g -- disable-tls false.
I just add this because it worked for me, i install composer with the developer option activate (just check the box in the installer)
https://getcomposer.org/Composer-Setup.exe
I think this problem may occurs when you add a new version of php to your wamp server.
If you do this, you have to check if the extension_dir variable is configure to "env".
Then check if the php_openssl.dll exist in your phpx.x/ext folder. If there is not php_openssl.dll, you have to download it here :
http://www.telecharger-dll.fr/dll-php_openssl.dll.html
If it still not working, check if your apache server use the good php.ini file by running the following cmd command :
php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: C:\wamp64\bin\php\php7.4.7x64\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
If the loaded configuration file return (none), you have to check your appache/apache2.4.41/conf/httpd.conf file is configure with the proper phpIniDir and the correct module.
It must be something like this :
PHPIniDir "${APACHE_DIR}/bin"
LoadModule php7_module "${INSTALL_DIR}/bin/php/php7.4.7x64/php7apache2_4.dll"
Then restart apache and check the "apache/apache2.4.41/bin/php.ini" (wich is the one configure above by PHPIniDir) it must me like
You are running Composer with SSL/TLS protection disabled.
composer config --global disable-tls true
composer config --global disable-tls false
For me on Windows 10 none of those worked ... I had changed my local server from WAMP to Laragon and had to add the new path to the php.ini in the Environment Variables under:
Control Panel --> Advanced System Settings --> Environment Variables --> Path (double click) --> Browse... then navigate to the php.ini and click ok.
After that a reboot was needed and now composer works like a charm!
I had this issue on IIS on my new home server when attempting to install Magento. To fix it i added the above: extension=php_openssl.dll in my php.ini and then restarted my IIS server on Windows 10 Pro.
I was just having this issue, but these solutions weren't working since I installed PHP and Apache independently without Xampp or Wamp.
The problem for me turned out to be that I was trying to run composer from Git for Windows instead of cmd or PowerShell—where it turned out to be working fine.
My solution was to add a symlink from my /c/php/php.ini (C:\php\php.ini) to my /bin/ directory (C:\Program Files\Git\bin).
lot of answers already, but this is what worked for me (in case someone still needs it)
Just upgraded from php 7.3.x to 7.4.33 in Windows 10, and this error occurred to me, so Just went back to the composer.exe installer, re-run the installation process once again pointing to the new php 7.4. folder, and it worked.

We cannot install extension in admin panel in Magento 2.3.2

We have installed magento 2.3 community edition in windows. We use Xampp 7.2.20. Magento installation is done successfully and admin panel is running fine. But when we try to install any extension from extension manager section it shows different errors. The errors is like as followings:
Step 1: Readiness Check
Error! You need to resolve these issues to continue.
Check Updater Application Availability
Updater application is available.
Check Cron Scripts
Cron script readiness check passed.
Check Component Dependency
Component dependency is correct.
PHP Settings Check *
Need Help? PHP Extension Help
PHP Extensions Check
missing PHP extensions. Hide detail
The best way to resolve this is to install the correct missing extensions. The exact fix depends on our server, your host, and other system variables.
Our PHP extension help can get you started.
For additional assistance, contact your hosting provider.
In some cases, you might have two PHP configuration files: one for the PHP command line and for the web server. If so, make the change in both php.ini files. For details, see the php.ini reference.
We cannot understand what is the problem in php extension and php settings. We cannot understand which extension, library, module is missing to install extension.
If any one has solution please give us.
Check the following modules are installed and enabled on your server. This are the required PHP extension for Magento 2
bc-math
curl
gd, ImageMagick 6.3.7 (or later) or both
intl
PDO/MySQL
SimpleXML
soap
xml
xsl
zipmbstring
mbstring
mcrypt
mhash
openssl

Composer fails installing laraveldaily/quickadmin

While intstalling laraveldaily/quickadmin I got the following error.
Please help me to solve my problem.
As you can read in the error message
intervetion/image requires ext-fileinfo
You need to enable ext-fileinfo by editing your php.ini and change the following line by removing the ; at the beginning.
From:
;extension=php_fileinfo.dll
To:
extension=php_fileinfo.dll
Find out which php.ini to edit
Run php --ini from a terminal. Make sure you run this command from terminal as the CLI version of PHP may have loaded another php.ini than the web version. Your phpinfo() may not contain the correct path.
As error describes, laraveldaily/quickadmin requires intervention/image which again requires ext-fileinfo. This library is maintained by php_fileinfo.dll
php_fileinfo.dll is a dll(library file) which contains modules to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file.
To fix this error first go to the directory of your php installation.Go to the ext folder and make sure that php_fileinfo.dll is present.
Now open your php.ini file (To locate that, type php --ini on the command line, also suggested by #peh) .
In the php --ini file just add the following line.
extension=php_fileinfo.dll
and recheck with the composer.

"Full REPL not supported. Falling back to simple shell" - error in Laravel While Trying To Use php artisan tinker

My Development Environment:
Windows 7 + WAMP
PHP Version: 5.4.16
While I try to use php artisan tinker - my console give me the following error:
REPL not supported. Falling back to simple shell
I search solution for this and found this :
Full REPL not supported
But this could not helped me much.I know Boris is By default supported by laravel 4.1.
And I might do some changes in php.ini according to this.
If the tinker command doesn't work for you, it is very likely the disable_functions setting in your php.ini contains the needed pcntl_() functions. Put a comment before this line in your php.ini and that should allow tinker to work.
Source :http://laravel-recipes.com/recipes/280
But when I Open my php.ini file the disable_functions contains nothing except this:
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
Is this My WAMP problem? Do I Missing Something !!!
Boris In Tinker
The php artisan tinker command now utilizes the Boris REPL if your system supports it. The readline >and pcntl PHP extensions must be installed to use this feature. If you do not have these extensions, >the shell from 4.0 will be used.
From the Laravel docs here:
http://laravel.com/docs/releases
So basically, they are telling you that php55-pcntl and readline needs to be installed.
Everytime I try to brew install php55-pcntl though, I get
configure: error: Cannot find openSSL's <evp.h>
Try running that and see what you get.
UPDATE: Use Laravel's Homestead environment
I completely gave up trying to run it on a XAMPP/WAMP/MAMP-style localhost.
If you go to the quickstart docs and scroll down to local development environment:
http://laravel.com/docs/quick#local-development-environment
It actually recommends you use Laravel's custom homestead environment:
http://laravel.com/docs/homestead
Read the docs for installing that and report back with results. It has been working perfectly for me.
One or more of readline posix and pcntl extensions are missing. You need to compile PHP with the appropiate configuration options to enabled it.
Here are the instructions:
readline http://www.php.net/manual/en/readline.installation.php
pcntl http://www.php.net/manual/en/pcntl.installation.php
posix http://www.php.net/manual/en/posix.installation.php
Note that posix functions are enabled by default.

PHP extension "curl" must be loaded

I'm trying to install a Magento on my server, and when I get to "Configuration", the installation launches:
PHP extension "curl" must be loaded.
I've checked my php.ini, and extension=php_curl.dll is not commented. For both Apache and PHP folders. I also checked my Wamp manager, and it looks like this:
.
So I guess that my php_curl is working fine... But I still get the same message when I install Magento:
.
Any idea on what's wrong?
I had the same problem. The mod_curl extension in wamp has a bug.
You can replace it with a newer version. I don't know which PHP-Version you use but here you can download a newer version. Download a TS (TheadSafe) version of the module and replace it with your existing curl module.
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
And a helpfull post:
http://forum.wampserver.com/read.php?2,85716
Replaced the old php_curl.dll with the new one in \wamp\bin\php\php5.4.3\ext\ by downloading from http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ .
Now its working. It is the error with recent wamp installation package.
You have to modify the php.ini files in your xampp folder. Three files in three different places need to be changed.
Follow the following steps to enable curl library with XAMPP in Windows:
Step 1:
Browse and open the following 3 files
C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini
Step 2:
Uncomment the following line in your php.ini file by removing the semicolon (;).
;extension=php_curl.dll
After that it will look something like something below-
extension=php_curl.dll
Step 3:
Restart your Apache server.
Step 4:
Check your phpinfo() to see whether curl has properly enabled or not.
Enjoy using curl() library.

Resources