开发者

get_file_contents not working on my server

开发者 https://www.devze.com 2023-01-05 09:23 出处:网络
I tested this script on another server and it worked fine. Do I have to set my php.ini file? And how?

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

精彩评论

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

关注公众号