2

I tried to Install composer on my PC (Windows 8 Pro 64x and XAMPP 3.2.1), so I downloaded Windows Installer and run it But I got this error:

The openssl extension is missing, which means that secure HTTPS transfers are impossible.

I searched about this problem and I tried some solutions

extension=php_openssl.dll

was uncomment in php.ini file in C:\xampp\php\php.ini and there's no other php.ini file on my system (I searched for it)

Also when I run "php --ini" command in CMD, I get this:

Configuration File (php.ini) Path: C:\windows

Loaded Configuration File: (none)

Scan for additional .ini files in: (none)

Additional .ini files parsed: (none)

if it helps.

I hope someone helps me. Tnx

Community
  • 1
  • 1
Ali Lotfi
  • 856
  • 3
  • 18
  • 40
  • since php says it's looking for a .ini file in c:\windows, the one you edited in c:\xampp is basically useless. – Marc B Jul 17 '14 at 20:01
  • But there's no php.ini file in c:\windows. is there any way to change it or add XAPMM php.ini file to "Loaded Configuration File"? – Ali Lotfi Jul 17 '14 at 20:04
  • exactly, so php's running with compiled-in defaults. – Marc B Jul 17 '14 at 20:05
  • So is there any way to change it or add C:\xampp\php\php.ini file to "Loaded Configuration File"? – Ali Lotfi Jul 17 '14 at 20:07
  • never used xampp. no idea why it'd be looking in c:\windows, which is a pretty stupid place for php to be storing its config. c:\windows should be hands-off for anyone but microsoft and driver writers these days. – Marc B Jul 17 '14 at 20:09

4 Answers4

1

";extension=php_openssl.dll" is commented out in the php.ini file. Simply remove the comment, save the file, rerun the Composer Install.

Compugasm
  • 11
  • 1
1

I've been battling the same issue since last week but was able to solve it today. First, I'm using XAMPP on Windows 10, so you're home as long as you've got XAMPP running on your PC.

(You may run phpinfo.php to know your settings (you can create a simple script file with that name , check for extension_path. It should point to the 'php\ext' folder (that's where mine is)) I set the path in php.ini to c:\xampp\php\ext. You can get to this file from the XAMPP control panel by clicking on CONFIGURE button corresponding to APACHE web server then, select 'php.ini' from the pop list. Search for extension_path and remove the comment directive (';').

Remember to stop and restart Apache web server from the XAMPP Control Panel.

That's all I did, my php code isn't much different from the one above. Try this and let me know how you fare.

0

C:\xampp\php\php.ini is the correct configuration file. Edit it and then make sure to restart Apache service for the change to take effect.

Salman
  • 3,761
  • 2
  • 23
  • 34
  • I tried this before, and it didn't work finally I put a copy of my php.ini file in C:\windows and it worked, but it seems dirty – Ali Lotfi Jul 20 '14 at 07:51
  • In any case. `phpinfo()` should tell you exactly where the configuration is loaded from. – Salman Jul 20 '14 at 22:31
0

Even I had this error while installing composer in my PC, try this:

1- Open C:\php\php.ini

2- Find ;extension=openssl and remove ; , save it

3- Now go to

C:\xampp\php\ext

4- Copy all files

5- Now go to

C:\php\ext

6- Paste these files

Try now :) plz let me know if I did anything wrong

Community
  • 1
  • 1
  • 1
    is the `Open C:\php\php.ini ....` should be included in your steps? if so, you can revise this answer to include that step. – mmr May 29 '21 at 13:36