apache - PHP gives fatal error for curl extension in windows. curl_init undefined
Get the solution ↓↓↓i have tried everything to load curl extension but it is not displayed in the loaded extension list.
Answer
Solution:
In WAMPServer activating and deactivation extension for the WebServer (Apache) is simple
Use the WAMPServer menus, on the icon in the system tray (it may need to be takes out of the extension area to make sure it sits on the taskbar all the time.
left click wampmanager -> PHP -> PHP Extensions
You should see a menu popout like this
Notice, the extension names all listed, if they have a Green Tick then they are activated, if not, they are not. To activate or deactivate the extension click the extensions name. Wait 10 second while WAMPServer restarts Apache automatically for you and there you go, Job Done.
If you want to use PHP CLI
The PHP CLI is controlled differently, there are actually 2php.ini
files. The one in thewamp64\bin\php\php{version}
controls the PHP CLI.
You have to edit this one yourself, so editwamp64\bin\php\php7.4.16\php.ini
and make sure that
extension=curl
does not have a#
comment in front of it
Its a little odd that it is not already activated as WAMPServer comes, out of the box, with the curl extension pre-activated
Answer
Solution:
as I was using multiple versions of PHP so after deselecting the current version, selecting another version and then again selecting back the current version and then restarting the server made it work.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: mysqli::real_connect(): (hy000/2002): connection refused
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.