enable curl in xampp, windows

trying to enable curl in xampp 3.0.12 in windows environment.

Updated the php.ini in the php folder to enable curl, and there is no php.ini file in the apache/bin folder.

phpinfo() says:

and when i try to run a http_get() command php says:

Fatal error: Call to undefined function http_get()

Restarted both windows and xampp several times to update the changes.

Would be grateful for some advice, as I searched through similar topics on the web but can't get any further.

Upvotes: 1

Views: 3057

Answers (1)

hek2mgl
hek2mgl

Reputation: 157967

Note that the function http_get() belongs to the pecl http extension and not to the curl extension. Refer to the documentation of the curl extension to learn how you can use it to retrieve documents via http. You'll also find a lot of posts on stackoverflow

Also note, that the function file_get_contents() can be used to get documents over http in a very simple way. Although it is limited it will fit in much cases. To retrieve a page you can issue:

file_get_contents('http://www.server.com/page.html');

Upvotes: 2

Related Questions