Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>'; 
?>
share|improve this question
7  
.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
2  
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

2 Answers 2

up vote 2 down vote accepted

When you install curl on a Ubuntu/Debian system, it is automatically loaded in your php installation with:

$ cat /etc/php5/conf.d/20-curl.ini
; configuration for php CURL module
; priority=20
extension=curl.so

You shouldn't do anything, apart restarting your webserver or cgi pool, e.g.:

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/php-fpm restart
share|improve this 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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