我有問題,但不知道在哪裏解決它。我的模板在xampp中運行良好,但在主機服務器上不起作用。我收到以下消息:服務器錯誤消息:沒有文件訪問
警告:file_get_contents()
[function.file-get-contents]:在主頁/....../ twitter.php的服務器配置中禁用URL文件訪問。
的錯誤是在線64
<?php
/*
For use in the "Parse Twitter Feeds" code below
*/
define("SECOND", 1);
define("MINUTE", 60 * SECOND);
define("HOUR", 60 * MINUTE);
define("DAY", 24 * HOUR);
define("MONTH", 30 * DAY);
function relativeTime($time)
{
$delta = time() - $time;
if ($delta < 2 * MINUTE) {
return "1 min ago";
}
if ($delta < 45 * MINUTE) {
return floor($delta/MINUTE) . " min ago";
}
if ($delta < 90 * MINUTE) {
return "1 hour ago";
}
if ($delta < 24 * HOUR) {
return floor($delta/HOUR) . " hours ago";
}
if ($delta < 48 * HOUR) {
return "yesterday";
}
if ($delta < 30 * DAY) {
return floor($delta/DAY) . " days ago";
}
if ($delta < 12 * MONTH) {
$months = floor($delta/DAY/30);
return $months <= 1 ? "1 month ago" : $months . " months ago";
} else {
$years = floor($delta/DAY/365);
return $years <= 1 ? "1 year ago" : $years . " years ago";
}
}
/*
Parse Twitter Feeds
*/
function parse_cache_feed($usernames, $limit, $type) {
$username_for_feed = str_replace(" ", "+OR+from%3A", $usernames);
$feed = "http://twitter.com/statuses/user_timeline.atom?screen_name=" . $username_for_feed . "&count=" . $limit;
$usernames_for_file = str_replace(" ", "-", $usernames);
$cache_file = dirname(__FILE__).'/cache/' . $usernames_for_file . '-twitter-cache-' . $type;
if (file_exists($cache_file)) {
$last = filemtime($cache_file);
}
$now = time();
$interval = 600; // ten minutes
// check the cache file
if (!$last || (($now - $last) > $interval)) {
// cache file doesn't exist, or is old, so refresh it
$cache_rss = file_get_contents($feed); (this is line 64)
如何給我的主機服務器上此訪問任何幫助嗎?
林主持1and1.co.uk。我可以自己做出改變嗎,或者我必須打電話給他們,他們這樣做? – iMayne 2010-04-08 23:09:26
抱歉,沒有1&1的經驗。我只是打電話給他們問。 – user187291 2010-04-08 23:30:54