curl_init() 没有定义.请定义或include

解决方案 »

  1.   

    phpinfo看下
    或者
    function_exists()下
    看是否已经支持CURL
      

  2.   

    curl_init()  怎么定义啊
      

  3.   

    php_curl.dll CURL,客户端 URL 库函数库 需要:libeay32.dll,ssleay32.dll(已附带) 
    请将支持库放在系统搜索路径中
      

  4.   

    <html>
    <title>A Simple Store</title>
    <table width='100%' cols='2' border='3px'>
    <colgroup span='2'>
    <col width='20%'></col>
    <col width='80%'></col>
    </colgroup>
    <tr><td colspan='2'><center><h1>Simple Store</h1></center></td></tr>
    <tr><td  valign='top'>
    <table width='100%' align='left' height='100%'>
    <?php
    define('KEYID','[YourAccessKeyIdHere]');
    define('AssocTag','[YourAssocitaeTagHere]');
    if($_GET['Action'] == 'Search'){
             print("
                               <formname='SearchTerms'action=SimpleStore.phpmethod='GET'>
    <tr><td valign='top'>
    <b>Choose a Category</b><br>
    <div align='center'>
    <select name='SearchIndex'>
                                                     <option value='Books'>Books</option>
                                                     <option value='DVD'>DVD</option>
                                                     <option value='Music'>Music</option>
    </select>
    </div>
    </td></tr>
    <tr><td><b>Eneter Key Words</b><br>
                                 <input type='text' name='Keywords' size='40'/></td></tr>
      <input type='hidden' name='Action' value='Search'>
      <input type='hidden' name='ItemPage' value='1'>
      <input type='hidden' name='CartId' value=$CartId>
      <input type='hidden' name='HMAC' value=$HMAC>
      <tr align='center'><td><input type='submit'/></td></tr>
    </form> ");
    }
    ?>
    </table>
    <td>
    <?php
    if($_GET['Action'] == 'Search'){
    if($_GET['Keywords'] == ''){
    print("Please enter keywords for your search.");
    }else{
    $keywords = urlencode($_GET['Keywords']);
    ItemSearch($_GET['SearchIndex'], $keywords, $_GET['ItemPage']);
    }
    }
    if($_GET['Action'] == 'SeeDetails'){
    ItemLookup($_GET['ASIN'], $_GET['SearchIndex']);
    }
    if($_GET['Action'] == 'CartAdd'){
    if($_GET['CartId'] != ''){
    CartAdd($_GET['ASIN']);
    }else{
    CartCreate($_GET['ASIN']);
    }
    }
    if($_GET['Action'] == 'Remove'){
    removeFromCart($_GET['CartItemId']);
    }
    ?>
    </td>
    </table>
    <table width='100%'>
    <tr><td colspan="2"><font size="2px"><br><center>Copyright 2006, Simple Store<br>Product information and pictures Copyright Amazon</center></font></td></tr>
    </table>
    <?php
    function ItemSearch($SearchIndex, $Keywords, $ItemPage){
    $request="http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=".KEYID."&AssociateTag=".AssocTag."&Version=2006-09-11&Operation=ItemSearch&ResponseGroup=Medium,Offers";
    $request.="&SearchIndex=$SearchIndex&Keywords=$Keywords&ItemPage=$ItemPage";
    //The use of `file_get_contents` may not work on all servers because it relies on the ability to open remote URLs using the file manipulation functions. 
    //PHP gives you the ability to disable this functionality in your php.ini file and many administrators do so for security reasons.
    //If your administrator has not done so, you can comment out the following 5 lines of code and uncomment the 6th.  
    $session = curl_init($request);这个是代码,执行到这里就报错了.TO:xuzuning(唠叨) 
       我把php_curl.dll,libeay32.dll,ssleay32.dll,都导入到系统目录下了,但是..
      

  5.   

    我在网上面找的http://www.programmingtalk.com/showthread.php?t=26167应该可以解决,他里面说的跟你们说的我都做了,怎么还是出不来,郁闷啊
      

  6.   

    怀疑你改的php.ini不是php所加载的.先phpinfo()一下,看第6行,这个是php所加载的php.ini的路径,尝试修改这个php.ini
      

  7.   

    year,调式出来了,谢谢大家了
    thinks!
      

  8.   

    php_curl.dll 复制到php安装目录下的ext下,libeay32.dll和ssleay32.dll复制到php安装目录下。开启extension=php_curl.dll,重启apache即可。
      

  9.   

    php_curl.dll 本来 就在ext下。libeay32.dll和ssleay32.dll本来就在到php安装目录下
      

  10.   


    我真是服了你了。
    已经说了安装目录下有这三个dll文件,还在重复。
    我跟LZ的情况是一样的,安装目录下的ext文件夹里面有这个文件,另外的两个文件在安装目录里面也有。
      

  11.   

    我也跟楼主出现一样的问题,我是windows下,默认有那几个.dll文件,并且把那几个文件复制到windows/system32目录下,但是一运行试用文件发现提示方法不存在,11楼的话提醒了我,然来是wamp5上的php.ini不对应我的apache,然后我就打E:/wamp5/php/php.ini果然,那一句extension=php_curl.dll 没注释掉,赶紧去掉注释重启apache正常了呵呵
      

  12.   

    全部都是按你们说的做的,但还是不行,我用的是php5.2.14 
      

  13.   

    php.ini 文件里面找到php_curl.dll把前面的注释划掉!
      

  14.   

    http://www.forum.psoft.net/showthread.php?t=29775
      

  15.   

    you have not starting  the  service CURL of php 5
      

  16.   

    libeay32.dll和ssleay32.dll要复制放在system32下面 重启Apache就可以了
      

  17.   

    按他们说的做就行,如果还不行那一定是php.ini文件引入错啦
      

  18.   

    我跟你们的问题一样,目录也是正确的,路径也是正确的也打开了PHPinfo里面就是没有。
      

  19.   

    原来真要把那二个文件copy到system32下win7下是不认的。
      

  20.   

    win7不是找不到  是还有个注释没打开而已  他需要openssl
    extension=php_openssl.dll 也打开就行了
      

  21.   

    我也是,我都做了,还是不行,。我是win7系统。不知放到Ubuntu服务器上会怎么样
      

  22.   

    In order to use the CURL functions you need to install the CURL package. 
      

  23.   

    大家伙,我也解决了,wamp下面的那个php.ini是加载的C:\Program Files\wamp\bin\apache\Apache2.2.11\bin\php.ini 目录下面的,不是C:\Program Files\wamp\bin\php\php5.3.0\php.ini那个啊,救命啊。
      

  24.   

    全部都打开的都开了,我是win7 64位的。还是不行!
      

  25.   

    终于搞定了,要把 php 的安装放进 环境变量里面才可以。;E:\php5;E:\php5\ext;
      

  26.   


    Win7 64位拷贝libeay32.dll、ssleay32.dll(C:\AppServ\php5\)两个文件到Windows目录下
      

  27.   

    修改配置:
    1.修改php.ini,将;extension=php_curl.dll前面的分号去掉
    2.拷贝libeay32.dll、ssleay32.dll(C:\AppServ\php5\)两个文件到system32目录
    3.重启Apache(services.msc)即可
      

  28.   

    64位的机器应该是拷贝libeay32.dll、ssleay32.dll到SysWOW64目录,而不是System32目录。