0

我在使用 php cURL 脚本时遇到了一些问题。它在我的本地主机上运行良好,但在我的服务器上不起作用。我的服务器可以成功执行除此之外的其他 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] => )

这是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] => )

可能是什么原因,我该如何解决?

4

1 回答 1

0

您的托管服务提供商阻止了端口 8080。共享主机尤其如此

于 2013-08-06T23:55:31.623 回答