0
我一直在使用php cURL腳本有一些問題。它在我的本地主機上運行良好,但它不起作用在我的服務器上。我的服務器可以成功執行除此之外的其他捲髮腳本。 這是print_r(curl_getinfo($ch));
從我的服務器結果:cURL不工作
Array ([url] => http://xx.xx.xx.xx:8080/bulksms/bulksms
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 15.00012
[namelookup_time] => 0.000145
[connect_time] => 0
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[certinfo] => Array ()
[primary_ip] => xx.xx.xx.xx
[primary_port] => 8080
[local_ip] =>
[local_port] => 0
[redirect_url] =>)
這裏是print_r(curl_getinfo($ch));
從我的本地結果:
Array ([url] => http://xx.xx.xx.xx:8080/bulksms/bulksms
[content_type] => text/html;charset=UTF-8
[http_code] => 200
[header_size] => 141
[request_size] => 178
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.89
[namelookup_time] => 0
[connect_time] => 0
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 4
[speed_download] => 4
[speed_upload] => 0
[download_content_length] => 4
[upload_content_length] => 0
[starttransfer_time] => 0.89
[redirect_time] => 0
[certinfo] => Array ()
[primary_ip] => xx.xx.xx.xx
[primary_port] => 8080
[local_ip] => 127.0.0.1
[local_port] => 3925
[redirect_url] =>)
可能是什麼原因,我該如何解決這個問題?
什麼是'curl_error($ ch)'說? – anq
據我可以告訴這些curl_getinfo之間的差異是:[local_ip]沒有設置在您的實時服務器無法正常工作。 – DrCord
@anq:curl_error($ ch);不會返回任何錯誤。它顯示一個空白頁面。 – Toni