2

我最近将我的服务器更改为 php5,以下代码在旧服务器(php 4)上运行良好,但现在它停止在我的新服务器(php5)上运行。它没有显示任何错误消息。

    ini_set('display_errors', true);
    ini_set('error_reporting', E_ALL);

    $ch = curl_init();                                                    
    curl_setopt($ch, CURLOPT_URL, $url); // set url to post to 
    curl_setopt($ch, CURLOPT_FAILONERROR, 1); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable 
    curl_setopt($ch, CURLOPT_TIMEOUT, 10); // times out after 10s 
    curl_setopt($ch, CURLOPT_POST, 1); // set POST method 
    curl_setopt($ch, CURLOPT_POSTFIELDS, "category=".$heading."&county=".$county."&sorttype=1"); // add POST fields 

    $myHeader = array("Content-Type: application/x-www-form-urlencoded", "Accept-Charset: utf-8");
    curl_setopt($ch, CURLOPT_HTTPHEADER, $myHeader); 

    $result = curl_exec($ch); // run the whole process 

    curl_close($ch);

如果在 php4 和 php5 之间有什么我需要关心的,请帮助我

4

0 回答 0