Heim  >  Artikel  >  Backend-Entwicklung  >  php内存限制

php内存限制

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

上传文件时候用了file_get_contents报错:

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

原来是在php里面有个配置项是用来控制最大内存的参数

<code>memory_limit = 1024M</code>

调节这个参数就好。

回复内容:

上传文件时候用了file_get_contents报错:

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

原来是在php里面有个配置项是用来控制最大内存的参数

<code>memory_limit = 1024M</code>

调节这个参数就好。

楼主正解哦。

是这样。。。你也可以在方法体开头设置这个值

php.ini文件的基本配置要熟悉

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn