You have to go through a lot of hoops to get CuRL working on Windows. I decided to put up a list that I could refer back to if I ever needed to re-install PHP and Curl on my windows box.
Note: Apparently it is much easier to install Curl on Linux. I’ll admit I havent tried it, but if you are trying to decide between the two, that is one thing to consider.
Note: I’m assuming you already have Apache installed.. you’re going to need it.
1. Back up your original PHP directory (if any) from C:/Program Files/PHP to C:/Program Files/PHP_orig
2. Download the latest PHP 5 binaries from http://www.php.net. Dont use the Windows installer.
3. Extract the zip file to C:/Program Files/PHP (this will be our ‘install’ directory)
4. Rename C:/Program Files/PHP/php.ini-dist to php.ini (or if your php.ini file already exists, dont do anything)
5. Edit your php.ini file to
Turn register_globals on (off by default)
;for curl
register_globals = On
;register_globals = Off
set extensions_dir to C:/Program Files/PHP/extensions
6. Edit your php.ini file to
Set upload_tmp_dir and session.save_path
upload_tmp_dir=”C:\WINDOWS\Temp”
session.save_path=”C:\WINDOWS\Temp”
(create that directory first)
7. Edit your php.ini file to enable any extensions that you may need
You will want to uncomment the following line:
extension=php_curl.dll
In addition, if you (like me) are using MySQL with PHP, then uncomment the following line to enable the MySQL extension.
extension=php_mysql.dll
I also recommend going through the list of remaining extensions and enabling the ones you need. If you are unsure about an extension, google is your friend.
8. Copy php5ts.dll from C:/Program Files/PHP to your Apache bin directory
(in my case, C:\Program Files\Apache Software Foundation\Apache2.2\bin)
9. Copy libeay32.dll and ssleay32.dll (located in C:/Program Files/PHP) to c:\windows\system32
10. Download cURL for Windows at: http://curl.haxx.se/download.html
I chose the Win32 – Generic version (version 7.19.5 at the time of this writing) with SSL (if you dont need SSL you can use a version without SSL). Unzip cURL to C:/Program Files/curl
11. (If you need SSL) Download OpenSSL for Windows from http://curl.haxx.se/download.html. Extract libssl32.dll to C:/Program Files/curl
12. Check to see if you have the following file: C:/WINDOWS/system32/msvcr70.dll. If not, find it via google and download it to system32.
13. Uncomment the curl line in your php.ini file to enable curl: extension=php_curl.dll
(If not already done earlier)
14. edit your Apache httpd.conf file to enable php:
Uncomment or add the following lines:
PHPIniDir “C:/Program Files/PHP/”
LoadModule php5_module “C:/Program Files/PHP/php5apache2_2.dll”
15. Edit your Apache httpd.conf file to recognize php extensions:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php index.html
Also add Line:
AddType application/x-httpd-php .php
15. Restart the Apache service
16. Create index.php in your Apache documentRoot with the following contents:
<?php
phpinfo();
?>
17. Go to http://localhost/index.php
You should see a section for “curl” and one for “mysql”, saying these options are enabled.
Done.







2 users commented in " How to set up PHP 5 with Curl and MySQL support on Windows "
Follow-up comment rss or Leave a TrackbackHi,
Steps are very well defined. It really help me to sort out problem.
Thanks Buddy
I agree this is a very good article. I didn’t implement but it has helped me understand in my head what needs to be done. Before I actually try to do it I have a couple of questions I hope you can answer.
I have wampserver 2.0 do you think if I followed these instructions, except changing the paths, that it would still work or be a disaster? I guess the same question would apply for xampp
Also could you be a bit more specific as to what to download from the php site, with a screenshot if possible. This little detail is causing a lot of confusion for me.
Leave A Reply