PHP Curl

If you are a web developer and having problems on Installing PHP Curl on Apache with PHP installed on Windows Operating System, below is my version of tonyspecer’scURL with PHP and Apache on Windows“.  The steps are simple and direct to the point.

I have windows apache version 2.2.14 and PHP Version 5.2.10 installed on my Laptop using the installers provided on the respective sites.

1.  Install APACHE and PHP (I installed my APACHE on C:\apache and PHP on C:\php directories )
2.  Edit the php.ini file found in the PHP directory.

  • Near line  546 set the extension directory extension_dir = “C:\php\ext”.  In my case I have my extensions files inside the ext folder. You can use any folder name as long as you set it in the php.ini file.
  • Near line 472 set register_globals = On
  • Near line 630 set session.save_path=”C:\WINDOWS\Temp” or you can set any directory

3.  On the PHP folder (in my case C:\php\) copy the php5ts.dll file to the bin folder of your Apache (C:\apache\bin\)
4.  On the PHP folder (C:\php\) copy libeay32.dll and ssleay32.dll to ” C:\WINDOWS\system32″  folder
5.  Download CURL for Windows found at http://curl.haxx.se/download.html and put it on the PHP folder (C:\php\curl)
6.  Download OpenSSL for Windows found at http://www.shininglightpro.com/products/Win32OpenSSL.html, for me I downloaded 7MB OpenSSL v0.9.8k Installer

7.  Check to see if you have the following file: c:\windows\system32\msvcr70.dll. If not, search for it in Google and download it to system32.  If you can’t find it in that directory click this link to download the file from www.dllfiles.com.  Extract the zipped file and put it in the “c:\windows\system32\”  folder.
8.  Uncomment the curl line in your php.ini file to enable curl:  extension=php_curl.dll but in my case I just added the line because it is not found in my php.ini file

9.  Edit the Apache httpd.conf file to enable php:

  • For newer version of Apache add at the bottom
    • LoadModule php5_module “C:/php/php5apache2_2.dll”
  • Then below add Line: AddType application/x-httpd-php .php

10.  Restart Apache and your curl should be working now.

Did find the post very useful? Maybe you want to buy me a glass of beer!