2010-04-08 2 views
1

문제점이 있지만 해결할 수있는 위치를 알 수 없습니다. 내 템플릿은 xampp에서 훌륭하게 작동하지만 호스트 서버에서는 훌륭하게 작동하지 않습니다. 이 메시지가 나타납니다 :서버 오류 메시지 : No File Access

경고 : file_get_contents() [function.file-get-contents] : URL 파일 액세스가 홈페이지 /......./ twitter.php의 서버 구성에서 비활성화되어 있습니다.

오류가

<?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) 

내 호스트 서버에서이 액세스 권한을 부여하는 방법에 어떤 도움 라인 (64)에인가? allow_url_fopenphp.ini

답변

2

서버 관리자에 on을 설정하지 않은 것처럼

+0

1and1.co.uk로 호스팅 중입니다. 내가 직접 변경을 할 수 있습니까? 아니면 전화를해야하고 할 수 있습니까? – iMayne

+0

죄송합니다, 1 & 1의 경험이 없습니다. 나는 그들에게 전화해서 물었다. – user187291

0

는 PHP 파일 기능을위한 URL에 접속 장애 (allow_url_fopen INI 설정)이 보인다. 사용 설정하도록 요청하거나 curl과 같은 다른 방법을 고려해보세요.

0

방금 ​​php.ini 파일을 만들고 추가 : "allow_url_fopen=on"을 저장하고 내 서버 및 wolla ...에 업로드했습니다. 작동합니다. 위의 녀석들에게 다시 한번 감사드립니다!

관련 문제