Installing Curl

If you're using Windows, you can enable Curl support by copying the files libeay32.dll and ssleay32.dll into your c:\windows\system32 folder, then enabling the extension in your php.ini file. Look for the line ";extension=php_curl.dll" and take the semi-colon off from the beginning.

If you're using Unix, you either have to install Curl support through your package manager, or you need to compile it from source. Compiling Curl support into your PHP takes two steps: installing the Curl development libraries on your machine (do this through your package manager), then recompiling PHP with the --with-curl switch in your configure line. As long as you have the development version of Curl installed, this should work fine.

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Your first Curl scripts >>

Previous chapter: Curl

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.