0

I have a php file that connects to a remote ftp server, and writes a file. Recently, I've been getting an error that says "File Size limit exceeded" everytime it tries to run the following command. This has worked in the past and it is just now starting to happen.

The file is just 2 lines of text, so there shouldn't be a file size issue. Can anybody help me debug what is going on?

$varrate =$result->GetLastRealTimeMetalQuotesResult->MetalQuote->Rate;
$varrate = round($varrate,2);

$res = array($varrate, $varclose);
    print_r($res);
    // it's rate then close
    echo "\n"; 
    echo "time to die is ";
    echo $stopitafteraminute-$est;
$fp=fopen("ftp://user:pass@website.com/public_html/rpc-server/textfile.txt", "w", 0, $stream_context);       
foreach($res as $key => $value)
    {
        fwrite($fp,$value."\n");
    }
fclose($fp);
4

1 回答 1

0

首先尝试在本地进行,如果它可以将目标文件夹的权限设置为 777(仅用于测试目的)如果它们都不起作用,那么问题是“流”。

而不是在循环中进行写入,而是创建文件然后写入。

$file = "";
foreach($res as $key => $value)
    {
        $file.=$value."\n";
    }
 fwrite($fp,$file);
于 2013-04-03T21:50:05.083 回答