Php Upload: Fatalerror: Allowedmemorysizeof

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.