PHP extension "curl" must be loaded - magento

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.

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.

Installing YAML for PHP in IIS

I am trying to install the YAML 1.2 extension to PHP 5.6 under IIS 10 (Windows 10). I am using http://pecl.php.net/package/yaml/1.2.0/windows to download the files.
I have downloaded the PHP 5.6 non-thread-safe DLL (x86 to match my version of PHP), copied php_yaml.dll to my extension directory, copied yaml.dll to C:\Windows\System32 (which is reported as one of the paths in phpinfo()) and added extension=php_yaml.dll to my php.ini. I've verified with phpinfo() that the correct php.ini file is being loaded, and commenting out other extensions removes them from the output of phpinfo().
However, YAML doesn't appear in the output of phpinfo() and the functions are not loaded. Running php-cgi.exe -v from the command line gives a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\php_5_06_14\ext\php_yaml.dll' - The specified module could not be found.
in Unknown on line 0
The file exists at the location specified and the permissions appear to be correct. What else can I do to get it working?
As far as I can tell, the use of PECL as package manager is being in dropping.
Having to install extensions in a server makes things more complicated and it depends on the environment, permissions, etc.
I'm sure someone could help you solve that (I haven't work on windows in years, so I can't)
But, instead I suggest you another solution. Maybe you can opt for it, maybe you have to stick with the extension, but, in case you can actually look for other option, I suggest you to use another library.
https://github.com/symfony/yaml
And, you could use Composer to install your libraries, I suggest you take a look at it.
Again, it may be for you or not, but I think this would be a lot easier.
I hope that helps.
I put the path to my extension directory in the path environment variable. That fixed the issue for me.

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.

Can't install php Composer, complaining about openssl

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

PHP extension “mcrypt” must be loaded.

I am installing magento CMS, and am trying to install the files. I am getting this error when I am in configuration mode.
PHP extension “mcrypt” must be loaded.
I am used to activating this extension by removing ; from extension=php_mcrypt.dll in php.in, but the problem is still present.
Why would this be happening and how do I fix this problem?
I recommend to restart the web server.
Run php file with
<?php
phpinfo();
and check whether there is a mcrypt extension, if no check path for right php.ini file.

Resources