Fix the “ext-sockets” error in composer:
If you tried to use composer and install any specific package/project (and probably, it’s the first time when you tried to install a package), in some cases you might see the following error:
The requested PHP extension ext-sockets * is missing from your system. Install or enable PHP's sockets extension.
To solve that error message, you need to do the following:
Solution 1
- Open the
php.ini
file, probably located in i.e.xamp\php
orwamp\bin\php\phpX.XX
(where XX is version number) - Search for
php_sockets.dll
and uncomment it (by removing the;
in front of it)
p.s. if your installation doesnt have php_sockets.dll
, you should download exactly version of PHP package from this link, from the archive, extract php_sockets.dll
and put in your php\ext
folder. Then try to install again, the error should be gone.
Solution 2
If you still get the error, that means you need to set correct path in php.ini
for extensions (and for other things too). For that, you need to replace the default path for variables in php.ini.
If still problem, then you can read the accepted answer here. You can comment here you solution and I will add that fix in this list.
Hey, thanks for the entire procedure for fixing error. I tried it and fixed successfully.