Home Backend Development PHP Tutorial php上载:Fatal error: Allowed memory size of

php上载:Fatal error: Allowed memory size of

Jun 13, 2016 am 10:52 AM
content filepath filesize header

php下载:Fatal error: Allowed memory size of
日志文件:tdnlog.log 大小:752MB

下载类

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    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;    }
Copy after login

文件在100MB之内正常 但超过就会报下面的错误 我把php.ini里面的memory_limit设置为512MB也不管用 这是怎么个情况啊

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->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
Copy after login


有一种解决办法是压缩为zip包

phpmyadmin的数据库导出下载就不会出现这个 它那个也没压缩 看了半天phpmyadmin的代码 各种混乱和纠结 求助吧


------解决方案--------------------
那就再改大点。800MB,900MB,1G ....都试下。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP Warning: filesize() [function.filesize]: stat failed solution PHP Warning: filesize() [function.filesize]: stat failed solution Jun 22, 2023 pm 11:54 PM

When developing PHP projects, we often encounter problems related to file operations. One of the problems that often occurs is the error prompt "PHPWarning: filesize()[function.filesize]:statfailed". This error message often makes people confused and it is difficult to find a solution. This article will introduce the cause and solution of this problem, hoping to help everyone. The cause of the problem is in PHP, filesize

How does SpringBoot pass parameters in the Header through Feign calls? How does SpringBoot pass parameters in the Header through Feign calls? May 16, 2023 pm 08:38 PM

[SpringBoot] Passing parameters in the Header through Feign calls How to pass Header parameters through Feign Problem description When we use Feign to request the Api interface of another service in Spring Cloud, there is a need to pass the parameters in the Header. If no special processing is done, it will The parameters in the Header will be lost. Solution 1: Pass it through @RequestHeader(name="headerName"). For example: Feign is defined as follows @FeignClient(name="service-name")pub

What does linux header mean? What does linux header mean? Jul 18, 2023 pm 03:34 PM

The Linux header refers to the beginning of a file or data stream, which is used to contain metadata about the content. By correctly writing and using Header files, developers can better utilize system resources and improve code readability and Maintainability.

How to use PHP header() method to adjust web pages How to use PHP header() method to adjust web pages Mar 28, 2023 pm 01:54 PM

PHP is a powerful programming language that can be used to create dynamic websites and web applications. One of the most powerful features is PHP’s header() method. In this article, we will explore how to use PHP’s header() method to adjust web pages.

How to jump in php header How to jump in php header Dec 02, 2022 am 09:14 AM

How to implement jump in php header: 1. Use "Header("Location:$url");" syntax to implement jump; 2. Use if judgment to implement jump, with jump statements such as "if($_COOKIE[" u_type"]){ header('location:register.php'); } else{ setcookie('u_type','1','86400*360');".

What is the difference between html5 tag head and header? What is the difference between html5 tag head and header? Jan 17, 2022 am 11:10 AM

Differences: 1. The head tag is used to define the head of the document, which is a container for all head elements, and the header tag is used to define the header (introduction information) of the document; 2. All browsers support the head tag, and older versions of browsers None of the browsers support the header tag, and browsers such as IE9+ and above are required to support the header tag.

How to solve 'undefined: filepath.Abs' error in golang? How to solve 'undefined: filepath.Abs' error in golang? Jun 24, 2023 pm 04:37 PM

In golang, filepath.Abs ​​is a very commonly used library. Its function is to obtain the absolute path of a relative path. However, in some cases, we will find that we will encounter an "undefined: filepath.Abs" error when using filepath.Abs, which means that we did not introduce the filepath library correctly or wrote the wrong syntax. This article explains how to resolve this error. First, we need to understand

How Nginx distributes through the identity in the header How Nginx distributes through the identity in the header May 11, 2023 pm 04:01 PM

Nginx can distribute requests to different servers based on custom identifiers in the request headers. Specifically, you can use the map directive to map the custom identifier in the request header to a different backend server address, and then use the proxy_pass directive to forward the request to the corresponding backend server. The following is an example configuration file: http{map$http_my_header$backend{defaultbackend1.example.com;value1backend2.example.com;value2backend3.example.com;}upstreambackend1{serv

See all articles