开发者

get_file_contents not working on my server

I tested this script on another server and it worked fine. Do I have to set my php.ini file? And how?

<开发者_StackOverflow中文版?php

ini_set('allow_url_fopen', 1);

if (!isset($_GET['url'])) {
    exit();
}

echo file_get_contents($_GET['url']);

?>


From the PHP Manual on allow_url_fopen

Note: This setting can only be set in php.ini due to security reasons.

Open the PHP.ini file with an editor and change the setting accordingly. If this on shared hosting and you do not have access to the PHP.ini contact your hosting service and ask them if they could change the setting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜