我最近将我的服务器更改为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之间的任何事情,请帮助我