Allowed memory size of aaaaa bytes exhausted tried to allocate bbbbb bytes

WBOY
Release: 2016-07-29 09:01:32
Original
1259 people have browsed it

PHP reported this error when using Mysql

The translation is that the memory of the size of aaaaaa bytes is exhausted (when trying to allocate bbbbb bytes)

If the value of bbbbb is larger than aaaaa, it means that the memory is small It's not enough anymore. At this time, we need to modify the settings and make the settings larger:

Now record the solution as follows:

1. Modify php.ini (recommended):

Search the memory_limit field in php.ini and modify it, such as

memory_limit = 128M

2. Add the following statement in the program
Add the following setting configuration statement in the .php code:

ini_set("memory_limit ", "128M");

In fact, there is another situation, that is, the value of bbbbb is much smaller than the value of aaaaa:

At this time, it is not a memory problem, but a program problem. It may be in your program Mysql-related content is not enabled. Please check the authenticity of the code related to the database connection

The above introduces Allowed memory size of aaaaa bytes exhausted tried to allocate bbbbb bytes, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!