Home  >  Article  >  Backend Development  >  php memory limit

php memory limit

WBOY
WBOYOriginal
2016-08-18 09:16:301014browse

I used file_get_contents when uploading files and reported an error:

<code>Allowed memory size of 134217728 bytes exhausted (tried to allocate 169854368 bytes)</code>

It turns out that there is a configuration item in php that is used to control the maximum memory parameter

<code>memory_limit = 1024M</code>

Just adjust this parameter.

Reply content:

I used file_get_contents to report an error when uploading files:

<code>Allowed memory size of 134217728 bytes exhausted (tried to allocate 169854368 bytes)</code>

It turns out that there is a configuration item in php that is used to control the maximum memory parameter

<code>memory_limit = 1024M</code>

Just adjust this parameter.

The original poster has the right answer.

That’s right. . . You can also set this value at the beginning of the method body

Be familiar with the basic configuration of the php.ini file

Statement:
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