curl_init() fails - Tried everything but curl() doesn't load
Posted: Mon Dec 27, 2010 10:36 am
Hi Everyone,
I have a stock install of CentOS 5.4 and php is install on it. But I continuously get this error when trying curl:
Fatal error: Call to undefined function curl_init() in /tmp/curlTest.php on line 3
Contents of file curlTest.php:
Following are all my packages. I also tried reinstall of all using Yum but above error still remains:
[root@localhost]# locate curl.so
/usr/lib/libcurl.so
/usr/lib/libcurl.so.3
/usr/lib/libcurl.so.3.0.0
[root@localhost]# ls /etc/php.d/
dbase.ini gd.ini ldap.ini mbstring.ini mysqli.ini odbc.ini pdo_mysql.ini pdo_sqlite.ini xmlrpc.ini xsl.ini
dom.ini imap.ini libcurl.so mcrypt.ini mysql.ini pdo.ini pdo_odbc.ini xmlreader.ini xmlwriter.ini
Here is the portion of the /etc/php.ini that I made the change:
I also tried:
extension=curl.so and it was not working as well.
I did "service httpd restar" multiple times and the error stay.
Thanks
I have a stock install of CentOS 5.4 and php is install on it. But I continuously get this error when trying curl:
Fatal error: Call to undefined function curl_init() in /tmp/curlTest.php on line 3
Contents of file curlTest.php:
Code: Select all
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/";);
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>
Following are all my packages. I also tried reinstall of all using Yum but above error still remains:
[root@localhost html]# rpm -qa | grep php
php-common-5.1.6-27.el5_5.3
php-odbc-5.1.6-27.el5_5.3
php-xmlrpc-5.1.6-27.el5_5.3
php-devel-5.1.6-27.el5_5.3
php-cli-5.1.6-27.el5_5.3
php-pdo-5.1.6-27.el5_5.3
php-mcrypt-5.1.6-15.el5.centos.1
php-gd-5.1.6-27.el5_5.3
php-imap-5.1.6-27.el5_5.3
php-ldap-5.1.6-27.el5_5.3
php-pear-1.4.9-6.el5
php-5.1.6-27.el5_5.3
php-mbstring-5.1.6-27.el5_5.3
php-xml-5.1.6-27.el5_5.3
[root@localhost]# locate curl.so
/usr/lib/libcurl.so
/usr/lib/libcurl.so.3
/usr/lib/libcurl.so.3.0.0
[root@localhost]# ls /etc/php.d/
dbase.ini gd.ini ldap.ini mbstring.ini mysqli.ini odbc.ini pdo_mysql.ini pdo_sqlite.ini xmlrpc.ini xsl.ini
dom.ini imap.ini libcurl.so mcrypt.ini mysql.ini pdo.ini pdo_odbc.ini xmlreader.ini xmlwriter.ini
Here is the portion of the /etc/php.ini that I made the change:
Code: Select all
; For example:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;;;;
; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
;;;;
[php-curl]
extension=libcurl.so extension=curl.so and it was not working as well.
I did "service httpd restar" multiple times and the error stay.
Thanks