Php Download: Fatalerror: Allowedmemorysizeof log File: tdnlog. log size: 752MB download class PHPcodefunctiondownload ($ filepath, $ filename) {if (! $ Filename) $ filenamebasename ($ file php Download: Fatal error: Allowed memory size
Log File: tdnlog. log: 752 MB
Download class
PHP code
function download($filepath, $filename = '') { if(!$filename) $filename = basename($filepath); if(is_ie()) $filename = rawurlencode($filename); $filetype = fileext($filename); $filesize = sprintf("%u", filesize($filepath)); if(ob_get_length() !== false) @ob_end_clean(); header('Pragma: public'); header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: pre-check=0, post-check=0, max-age=0'); header('Content-Transfer-Encoding: binary'); header('Content-Encoding: none'); header('Content-type: '.$filetype); header('Content-Disposition: attachment; filename="'.$filename.'"'); header('Content-length: '.$filesize); readfile($filepath); exit; }
If the file size is within MB, the following error will be reported. I set memory_limit in php. ini to MB, no matter what the problem is.
PHP code
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 750743553 bytes) in /var/www/nms/framebase/libs/functions/extention.func.php on line 233
One solution is to compress the file into a zip package.
If the phpmyadmin database is exported and downloaded, it will not appear. it is not compressed. after reading The phpmyadmin code for a long time, it may be confusing and difficult to ask for help.
------ Solution --------------------
Then change the value to a greater value. 800 MB, 900 MB, 1G... all try.