php下载:fatal error: allowed memory size of
日志文件:tdnlog.log 大小:752mb
下载类
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; }
文件在100mb之内正常 但超过就会报下面的错误 我把php.ini里面的memory_limit设置为512mb也不管用 这是怎么个情况啊
php codefatal 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
有一种解决办法是压缩为zip包
phpmyadmin的数据库导出下载就不会出现这个 它那个也没压缩 看了半天phpmyadmin的代码 各种混乱和纠结 求助吧
------解决方案--------------------
那就再改大点。800mb,900mb,1g ....都试下。