link 不在服务器中打开,但在本地工作
The link does not open in server but works in local
我在本地试过,它显示 $arr[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
更改端口后有效。
我在本地试过,它显示 $arr[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
更改端口后有效。