I have installed curl:

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

and I have updated my php.ini file to include(I also tried .so):

extension=php_curl.dll

To test if curl is working I created a file called testCurl.php which contains the following:

<?php
echo ‘<pre>’;
var_dump(curl_version());
echo ‘</pre>’;
?>

When I navigate to localhost/testCurl.php I get an error: HTTP Error 500

Heres a snippet from the error log:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot op$

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open sha$

[Sun Dec 25 12:10:17 2011] [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.3 with Suhosin-Patch configured -- resuming normal operations

[Sun Dec 25 12:13:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: http://localhost/

[Sun Dec 25 12:13:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: http://localhost/

[Sun Dec 25 12:13:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: http://localhost/

[Sun Dec 25 12:13:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: http://localhost/`

Can anyone help me to get curl working?

The problem was with the original test code. I used a new test file containing this and curl is now working:

<?php 
## Test if cURL is working ## 
## SCRIPT BY WWW.WEBUNE.COM (please do not remove)## 
echo '<pre>'; 
var_dump(curl_version()); 
echo '</pre>'; 
?>
link|improve this question
4  
.dll? are tou sure? try curl.so – Marcelo Bittencourt Dec 30 '11 at 3:47
I tried php_curl.so too but still no luck. localhost/testCurl.php gives me an HTTP 500 error... – Afsheen Khosravian Dec 30 '11 at 3:52
Many of the extensions enable themselves when installed. Try it without the line you added to php.ini and check for a curl.ini file in your php config directory. (And definitely not a .dll on Ubuntu) – cyberx86 Dec 30 '11 at 3:58
1  
also, you need to restart the apache server after any changes in php.ini. – Marcelo Bittencourt Dec 30 '11 at 4:30
1  
Did you check if the files are in /usr/lib/php5/20090626+lfs/ ? – Marcelo Bittencourt Dec 30 '11 at 18:18
show 7 more comments
feedback

1 Answer

I'm not positive (I'm a SysAd who's been supporting PHP and RoR Devs) but I think that to use curl in PHP-land, I had to install a module using PECL.

I'm sorry that I don't have more details, but it was at least 6 months ago, and we'd since migrated to a different ticketing system.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.