2010-04-15 3 views
0

Erg. 지난 며칠 동안 높은 짹짹 ID (적어도 그것은 ID와 관련이있는 것처럼 보입니다. 그러나 그것은 API 반환의 최근 변화 일 수 있다고 생각합니다)가 내 코드를 위반하고 있습니다. 처음에는이 함수에 정수 대신 문자열로 ID를 전달하려고 시도했지만이 방법이 효과적이라고 생각했지만 실제로는 내 끝에서 파일을 업로드하는 과정이었습니다.높은 트윗 상태 ID로 인해 스트림 오류를 열지 못했습니다?

약식으로 PHP 스크립트는 이러한 함수 호출을 생성하며, 그렇게하면 실패합니다. 전화가 생성 된 PHP 파일을 다운로드하고 서버 복사본을 삭제 한 다음 변경하지 않고 똑같은 파일을 다시 업로드하면 정상적으로 작동합니다. 누구든지이 문제를 일으킬 수있는 것을 알고 있습니까?

다음은 오류를 가져 오는 개별 파일에서 가장 중요한 부분 인 것으로 의심됩니다. 당신이 경우

 $postFileName = $single_post_id.".php"; 
    if(!file_exists($postFileName)){ 
    $created_at_full = date("l, F jS, Y", strtotime($postRow[postdate])-(18000)); 
    $postFileHandle = fopen($postFileName, 'w+'); 
    fwrite($postFileHandle, '<html> 
<head> 
<title><?php $thisTITLE = "escarp | A brief poem or short story by '.$authorname.' on '.$created_at_full.'"; echo $thisTITLE;?></title><META NAME="Description" CONTENT="This brief poem or short story, by '.$authorname.', was published on '.$created_at_full.'"> 
<?php include("head.php");?> 
To receive other poems or short stories like this one from <a href=http://twitter.com/escarp>escarp</a> on your cellphone, <a href=http://twitter.com/signup>create</a> and/or <a href=http://twitter.com/devices>associate</a> a Twitter account with your cellphone</a>, follow <a href=http://twitter.com/escarp>us</a>, and turn device updates on. 
<pre><?php 
    require "singlePost.php"; 
    SinglePost("'.$single_post_id.'") 
    ?> 
</div></div></pre><?php include("foot.php");?> 
</body> 
</html>'); 
    fclose($postFileHandle);} 
    $postcounter++; 
    } 

내가 더 게시 할 수 있습니다 : 파일의 각 (예를 들어 아래의 파일이 12058543656.php 이름)

<?php 
    require "singlePost.php"; 
    SinglePost(12058543656) 
    ?> 

가 여기에 위의 파일을 기록하는 코드의 상태 ID 지명된다 여기에는 아무 것도 보이지 않지만 관련 파일이 여러 개 있습니다. 무수한 코드를 덤핑하는 것을 피하려고합니다.

오류

:

Warning: include(head.php) [function.include]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 4 Warning: include(head.php) [function.include]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 4

Warning: include() [function.include]: Failed opening 'head.php' for inclusion (include_path='.:/nfsn/apps/php5/lib/php/:/nfsn/apps/php/lib/php/') in /f2/escarp/public/12177797583.php on line 4 To receive other poems or short stories like this one from escarp on your cellphone, create and/or associate a Twitter account with your cellphone, follow us, and turn device updates on.

Warning: require(singlePost.php) [function.require]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 7

Warning: require(singlePost.php) [function.require]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 7

Fatal error: require() [function.require]: Failed opening required 'singlePost.php' (include_path='.:/nfsn/apps/php5/lib/php/:/nfsn/apps/php/lib/php/') in /f2/escarp/public/12177797583.php on line 7

SinglePost()

<?php 
function SinglePost($statusID) { 
require "nicetime.php"; 
$db = sqlite_open("db.escarp"); 
$updates = sqlite_query($db, "SELECT * FROM posts WHERE postID = '$statusID'"); 
$row = sqlite_fetch_array($updates, SQLITE_ASSOC); 
$id = $row[authorID]; 
$result = sqlite_query($db, "SELECT * FROM authors WHERE authorID = '$id'"); 
$row5 = sqlite_fetch_array($result, SQLITE_ASSOC); 
    $created_at_full = date("l, F jS, Y", strtotime($row[postdate])-(18000)); 
    $created_at = nicetime($row[postdate]); 
    if($row5[url]==""){ 
    $authorurl = ''; 
    } 
    else{ 
    /*I'm omitting a few pages of output code and associated regex*/ 
    return; 
    } 
?> 
+0

정확한 오류 메시지와'SinglePost()'구현을 게시해야합니다. –

+0

게시 됨, SinglePost()가 비난하는 것은 아닙니다. 페이지의 아무 것도로드되지 않기 때문입니다. – escarp

답변

0

나는 높은 ID 값 문제 (관련 이상,하지 데이터 형)를 일으키는 의심한다.

PHP가 정수 오버플로를 감지하면 it automatically converts the value to a float이이를 방지합니다. 따라서 문제없이 큰 숫자를 (다소) 나타낼 수 있습니다.

, 파일의 전체 경로는 파일 시스템의 경로 길이 제한을 초과하지 않도록 확인하십시오 말했다되고 그건

및 폴더에있는 파일 수 (예를 들어 제한 중 하나를 초과하지 , 65534 항목은 NTFS 파티션의 최대 값입니다.

+0

글쎄, 나는 높은 ID가 PHP 자체에서 문제를 일으키는 것 같아요,하지만 나는 그것이 파일 시스템과 관련이 있다고 생각하지만 ID가 그 문맥에서 문제를 일으키는 것 같아요. ID가 10000000000 이상인 다른 10 개의 파일이 정상적으로 작동하므로 파일 길이가 길어지는 것은 아닙니다. 첫 번째 문제 ID는 12058543656입니다. – escarp

+0

@escarp : 같은 폴더에 너무 많은 파일이있을 수 있습니까? –

관련 문제