|
以windows下的php+apache為例。
首先,打開php.ini,找到“extension=php_curl.dll”,然后去掉前面的“;”注釋,重啟apache即可。
如果還出現此類問題,先檢查php.ini的extension_dir值是哪個目錄,在那個目錄下檢查有無php_curl.dll,沒有的話請下載php_curl.dll,再把php目錄中的libeay32.dll和ssleay32.dll拷到c:/windows/system32里面,重啟apache,OK!
在Ubuntu 下運行php,總是提示Call to undefined function curl_init(),原因沒有安轉:php5-curl
與curl相關的內容見:http://packages.ubuntu.com/zh-cn/intrepid/php5-curl
CURL is a library for getting files from FTP, GOPHER, HTTP server.
php5 is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique php-specific features thrown in. The goal of the language is to allow web developers to write dinamically generated pages quickly. This version of php5 was built with the Suhosin patch.
H1>
(php 4 >= 4.0.2)
curl_init -- 初始化一個CURL會話
描述
int curl_init ([string url])
curl_init()函數將初始化一個新的會話,返回一個CURL句柄供curl_setopt(), curl_exec(),和 curl_close() 函數使用。如果可選參數被提供,那么CURLOPT_URL選項將被設置成這個參數的值。你可以使用curl_setopt()函數人工設置。
例 1. 初始化一個新的CURL會話,且取回一個網頁
<?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.zend.com/");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
?>
參見:curl_close(), curl_setopt()
php技術:php運行出現Call to undefined function curl_init()的解決方法,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。