Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 2006-07-11
Medium Priority
Last Modified: 2013-12-12
pls i need a step by step information on how to install PHP with CURL(as in make PHP work with CURL)
as i have been reading so many articles and i don't seem to get it to work because i don't understand what they usually meant.
i have
PHP 4.4.1 and libcurl 7.15.3

Question by:xavier45
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 40

Expert Comment

by:Richard Quadling
ID: 17088468
What OS are you using? For Windows, edit your php.ini (or equivalent) and remove the ; in from of ;extension=php_curl.dll

Restart your web server.

From the manual for other OS.

In order to use PHP's CURL functions you need to install the libcurl package (which you've got, but not sure if it is installed correctly - make sure you follow libcurl's installation instructions - do they provide a test script to prove installation is successful?). PHP requires that you use libcurl 7.0.2-beta or higher. In PHP 4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0, you will need a libcurl version that's 7.9.8 or higher. PHP 5.0.0 requires a libcurl version 7.10.5 or greater.

Your version is OK.

To get curl active within *ix, you need to compile PHP. Again, from the manual ...

To use PHP's CURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use CURL for URL streams --with-curlwrappers.

Note to Win32 Users:
In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH.  You don't need libcurl.dll from the CURL site.


Author Comment

ID: 17105600
i'm on Win XP Pro and i after doing what you adviced i get this error when i try to open a PHP page that uses CURL

Fatal error: Call to undefined function: curl_init() in C:\Program Files\xampp\htdocs\grabgmail\GrabGmail.class.php on line 162

pls help
LVL 40

Expert Comment

by:Richard Quadling
ID: 17106592
If your php directory is NOT in your path - add it. This makes EVERYTHING a LOT easier.

RIght click "My Computer" and choose Properties|Advanced|Environment Variables|System Variables|Path|Edit

I use PHP a LOT!!!!, so my path is ...

C:\BATCH;C:\PHP5;C:\PEAR;C:\Program Files\WinRAR;C:\PKWare;D:\SAGE\UTILS;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Data\Web Sites\Quick Scripts\public_html;C:\Program Files\Support Tools\;C:\Program Files\Windows Resource Kits\Tools\;D:\cygwin\bin;C:\Essbase\bin;C:\Program Files\Intel\DMIX;D:\Program Files\InVu\;C:\Program Files\QuickTime\QTSystem\

I have C:\PHP5 near the front of the path. Just do. You don't need to if you just want to add it to the end.

Having saved that open a cmd prompt.

Type PATH [enter] just to make sure PHP is in the path.

If you are using a different directory then make sure you add that directory!

At the cmd prompt type

C:\>php -i | find "Configuration File" [enter]

This will return something like ...

Configuration File (php.ini) Path => C:\WINDOWS\php-cli.ini

The file (C:\window\php-cli.ini) could be anywhere/anything.

Edit that file and check that extension=php_curl.dll has no ; in front of it.

Save file.

Back at the cmd prompt type

C:\>php -m [enter]

You will get back something like ...

[PHP Modules]

[Zend Modules]
Zend Extension Manager

The actual list will depend upon your settings.

If you see curl there, then PHP managed to load the curl library and the functions are available.

If you get ANY error or CURL is not present, then let me know.

This is working, so far, at the cli version of windows.

Now create a file called info.php containing

<?php phpinfo(); ?>

And save that in your webroot somewhere.

Open your browser and open the info.php

Look for "Configuration File" and curl. See if the same config file is used (I use different ones for CLI/FCGI/CGI/ISAPI).

If you are using the same config file and curl is NOT present, restart your web server. Then recheck.

At this stage, any errors would be important.

Let me know.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 17112965
i couldn't get it to work because i'm lost

i did this "RIght click "My Computer" and choose Properties|Advanced|Environment Variables|System Variables|Path|Edit" and added this "C:\Program Files\xampp\php(thats my php installation dir)" but when i get to the command prompt it does not display that as part of the PATH items.

pls help
LVL 40

Expert Comment

by:Richard Quadling
ID: 17115611

You MAY need to reboot. I've never done so. Also, the change on affects NEW command prompt windows. Open ones CAN get the new environment, but I don't know how other than closing the program and then re-running it.

Author Comment

ID: 17118575
ok i was able to go pass all that now and cmd loaded all the modules including curl but when i get to the phpinfo page i could not find curl anywhere on that page(even after restarting my webserver).
LVL 40

Accepted Solution

Richard Quadling earned 1000 total points
ID: 17120834
And is the config file you edited the same one as is seen by the phpinfo() ?

And daft question, is YOUR pc also the webserver?

Author Comment

ID: 17126400
i ngot it working now...
the problem is from me(or should i say from xampp - for placing the php config file in the apache bin dir)
like i said earlier i use XAMPP and while i was busy editing and updating the PHP config file in the PHP dir, little did i know the config file is in the APACHE bin dir.

it was earlier this morning that i check their website at and found out about it from the FAQ section.

who reads the manual these days -:)

anyway thanks much

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question