If you need more control over the buffering, you can fread() a fixed-size buffer from HTTP and fwrite() the buffer to the output file as you read it. If (!file_put_contents($file, fopen($url, 'r', false, $context))) Assuming you're using PHP 5.1+, you can use fopen() and file_put_contents() together to buffer the file between HTTP and disk: array ( The most direct issue is that you're trying to allocate an extra 1GB of memory to your PHP script after it's already reached its 1GB limit (which is much higher than the default limit). $dailyxmlfile = fwrite($dailyfile, $indexfile) Īpache logs that 'file_get_contents($url, false, $context) ' is leading to max out the memory.Ĭurrently I'm trying to upload the (1,41gb file) in hope that I can process it this way.īased on the information provided, there are two issues here. $dailyfile = fopen("./myhomeservices/fullindex/files_index.xml", "w") or die("Unable to open file!") $file = './myhomeservices/fullindex/files_index.xml' $indexfile = file_get_contents($url, false, $context) Custom header (username/pass is a paid account, so I can't share the credentials) I believe the server hangs somewhere while running the script, as some XML files are beeing stored in the directory Is there a way to open up and dissect without my server to crash constantly? PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted Now I wish to do the same with the file, But everytime I try to open the index file the server stops with: xml in it and downloads them to a different folder so 1234.xml I have several scripts running that downloads the daily xml and looks for every.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |