简体   繁体   English

为什么获取请求在 php 中没有任何响应

[英]why get request is not respond anything in php

i am trying to get data from a website https://api.timescoaching.in/v1/courses but my php code is not return anything.And when i open this url https://api.timescoaching.in/v1/courses in browser it working fine. i am trying to get data from a website https://api.timescoaching.in/v1/courses but my php code is not return anything.And when i open this url https://api.timescoaching.in/v1/courses在浏览器中它工作正常。 I am sharing my php code please correct if there is any mistake我正在分享我的 php 代码,如果有任何错误请更正

<?php
$homepage = file_get_contents('https://api.timescoaching.in/v1/courses');
echo $homepage;
?>

If the site is hosted on a server and you have access to the php.ini file then change the value of allow_url_fopen = On;如果站点托管在服务器上,并且您可以访问 php.ini 文件,则更改 allow_url_fopen = On 的值; .Your error will be fixed, this error generates when the default value of allow_url_fopen is set to zero which does not allow any data interaction or url interaction with other urls. .您的错误将得到修复,当 allow_url_fopen 的默认值设置为零时会生成此错误,这不允许任何数据交互或 url 与其他 url 交互。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM