2017-10-21 101 views
0

我在本地试过这个作品,它显示了$改编[0]:链接打不开服务器,但在当地

try{ 
    $file= "http://IP:8030/app_dev.php/api/v1/get_jhoobin_users"; 
    $csv= file_get_contents($file); 
    $array = array_map("str_getcsv", explode("\n", $csv)); 
    foreach ($array as $arr){ 
     echo $arr[0]."<br>"; 
    } 
} catch(Exception $e) { 
    $error = $e->getMessage(); 
    echo $error; 
} 

但在服务器我的错误是: 的file_get_contents(http://IP:8030/app_dev.php/api/v1/get_jhoobin_users):未能开放流:连接超时在/var/www/html/SDP/other/microchargeNew40.php

+0

您在文件中提供的URL是您的本地服务器URL – GYaN

回答

0

改变端口后它工作。

相关问题