我使用php cURL脚本时遇到了一些问题。它在我的localhost上工作正常,但它在我的服务器上不起作用。我的服务器可以成功执行除此之外的其他curl脚本。
这是我的服务器print_r(curl_getinfo($ch));
的结果:
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] => )
以下是来自我的localhost的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] => )
可能是什么原因,我该如何解决这个问题?
答案 0 :(得分:0)
端口8080被您的托管服务提供商阻止。共享主机
尤其如此