You are not logged in.

#1 2011-09-15 09:18:03

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

[Solved] Can't get cURL to work in PHP

Hello.
I have this error: Call to undefined function curl_init...
In phpinfo() it says: ...'--with-curl=shared'...
"curl" package is installed.
"curl.so" in php.ini is uncommented.
"/usr/lib/libcurl.so" is in the system.

Why can't I use curl functions in php?

Last edited by Mr. Alex (2011-09-15 11:33:27)

Offline

#2 2011-09-15 10:26:16

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: [Solved] Can't get cURL to work in PHP

When run from terminal, what does

php -m

print?
Be sure to include any warnings, such as trying to load .so files which it cannot find.

Offline

#3 2011-09-15 10:32:54

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: [Solved] Can't get cURL to work in PHP

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
gettext
hash
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
pcntl
pcre
PDO
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

Offline

#4 2011-09-15 10:37:33

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: [Solved] Can't get cURL to work in PHP

Well there's the problem. But I don't know why you don't have curl.so as it comes with the php package. You could try re-installing php and seeing if it appears. Alternatively you could compile it yourself and add the .so to the folder.

Offline

#5 2011-09-15 11:31:34

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] Can't get cURL to work in PHP

php-curl was recently merged into the php package... make sure your php packages are up to date and that you've merged any pacnew files (particularly /etc/php/php.ini)

Offline

#6 2011-09-15 11:33:15

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: [Solved] Can't get cURL to work in PHP

I updated php package and it now works. Thanks.

Offline

#7 2012-08-07 19:28:57

rkelly
Member
Registered: 2012-08-07
Posts: 5

Re: [Solved] Can't get cURL to work in PHP

I had this same problem,and followed all these steps, but was still getting the Call to undefined function curl_init() in.. error.

This thread suggested a soft reboot. Did that and finally, the issue cleared up.
http://stackoverflow.com/questions/5320 … p-on-linux

Offline

Board footer

Powered by FluxBB