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

改變端口後它工作。

相關問題