I am trying to import a large .sql data file using phpMyAdmin in XAMPP. However this is taking a lot of time and I keep getting:
Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\dbi\DBIMysqli.class.php on line 285
And the file is about 1.2 million lines long.
The file is about 30MB big, so it is not that big. I don't really understand why it is taking so long.
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time=30000
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time=60
; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64
; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit=200M
The is the config file for php.ini in xampp, for some reason i still get
Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\dbi\DBIMysqli.class.php on line 285.
There's a configuration variable within the phpMyAdmin directory that you can find in phpmyadmin\config.inc.php called $cfg['ExecTimeLimit'] that you can set to whatever maximum execution time you need.
Well, to get rid of this you need to set phpMyadmin variable to either 0 that is unlimited or whichever value in seconds you find suitable for your needs. Or you could always use CLI(command line interface) to not even get such errors(For which you would like to take a look at this link.
Now about the error here, first on the safe side make sure you have set PHP parameters properly so that you can upload large files and can use maximum execution time from that end. If not, go ahead and set below three parameters from php.ini file,
max_execution_time=3000000 (Set this as per your req)
post_max_size=4096M
upload_max_filesize=4096M
Once that's done get back to finding phpMyadmin config file named something like "config.default.php". On XAMPP you will find it under "C:\xampp\phpMyAdmin\libraries" folder. Open the file called config.default.php and set :
$cfg['ExecTimeLimit'] = 0;
Once set, restart your MySQL and Apache and go import your database.
Enjoy... :)
Set Only 3 Parameters from php.ini file of your server
A. max_execution_time = 3000000 (Set as per your requirment)
B. post_max_size = 4096M
C. upload_max_filesize = 4096M
Edit C:\xampp\phpMyAdmin\libraries\config.default.php Page
$cfg['ExecTimeLimit'] = 0;
After all set, restart your server and import again your database.
Done
You're trying to import a huge dataset via a web interface.
By default PHP scripts run in the context of a web server have a maximum execution time limit because you don't want a single errant PHP script tying up the entire server and causing a denial of service.
For that reason your import is failing. PHPMyAdmin is a web application and is hitting the limit imposed by PHP.
You could try raising the limit but that limit exists for a good reason so that's not advisable. Running a script that is going to take a very long time to execute in a web server is a very bad idea.
PHPMyAdmin isn't really intended for heavy duty jobs like this, it's meant for day to day housekeeping tasks and troubleshooting.
Your best option is to use the proper tools for the job, such as the mysql commandline tools. Assuming your file is an SQL dump then you can try running the following from the commandline:
mysql -u(your user name here) -p(your password here) -h(your sql server name here) (db name here) < /path/to/your/sql/dump.sql
Or if you aren't comfortable with commandline tools then something like SQLYog (for Windows), Sequel Pro (for Mac), etc may be more suitable for running an import job
This worked for me.
If you got Maximum execution time 300 exceeded in DBIMysqli.class.php file. Open the following file in text editor
C:\xampp\phpMyAdmin\libraries\config.default.php then
search the following line of code:
$cfg[‘ExecTimeLimit’] = 300;
and change value 300 to 900.
https://surya2in1.wordpress.com/2015/07/28/fatal-error-maximum-execution-time-of-300-seconds-exceeded/
Simply set $cfg['ExecTimeLimit'] = 0; In xampp/phpMyAdmin/libraries/config.default.php.
Maximum execution time in seconds (0 for no limit).
And make this below changes in php.ini file as per file size.
post_max_size = 600M
upload_max_filesize = 500M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 600M
But make sure 'post_max_size' and 'memory_limit' should be more than upload_max_filesize.
**Note - Don't forget to restart your server.
If you are using the laragon and your database is phpMyAdmin the process is the same for tackle this error.
Open laragon right-click on it and open php.ini file
set these value accordingly to your needs
max_execution_time
post_max_size
upload_max_filesize
Open new file config.default.php
path is C:\laragon\etc\apps\phpMyAdmin\libraries\config.default.php
and set the value of this $cfg['ExecTimeLimit'] = 0;
Restart the laragon.
I hope it would solve your problem for laragon environment 🙏 #Happy Coding :)
Is it a .sql file or is it compressed (.zip, .gz, etc)? Compressed formats sometimes require more PHP resources so you could try uncompressing it before uploading.
However, there are other methods you can try also. If you have command-line access, just upload the file and import with the command line client mysql (once at the mysql> prompt, use databasename; then source file.sql).
Otherwise you can use the phpMyAdmin "UploadDir" feature to put the file on the server and have it appear within phpMyAdmin without having to also upload it from your local machine.
This link has information on using UploadDir and this one has some more tips and methods.
you must change php_admin_value max_execution_time in your Alias config (\XAMPP\alias\phpmyadmin.conf)
answer is here:
WAMPServer phpMyadmin Maximum execution time of 360 seconds exceeded
After trying many things with no success, I've managed to get SSH access to the server, and import my 80Mb database with a command line, instead of phpMyAdmin. Here is the command:
mysql -u root -p -D mydatabase -o < mydatabase.sql
It's much easier to import big databases, if you are running xammp on windows, the path for mysql.exe is C:\xampp\mysql\bin\mysql.exe
1-make a search in your local drive and type "php.ini"
2-you may see many files named php.ini you should choose the one that fits with your php version (see localhost)
3-open the php.ini file make a search on "max_execution_time" then make it equal to "-1" to make it unlimited
Never change original config.default.php file.
Changing general executing time in php.ini has no effect on phpmyadmin scripts.
Use a new config.inc.php or the config.sample.inc.php provided in the /phpMyAdmin folder instead.
You can set $cfg[‘ExecTimeLimit’] = 0; means endless execution in the config.inc.php as recommended above. Be aware this is not a "normal" ini file. Its a php script, so you need a open <?php at the beginning of that file.
But most important: Do not use this procedure at all! phpmyadmin is okay for small database but not for huge databases with several MB or GB.
You have other tools on a server to handle the import.
a) If you have a server admin
system like Plesk, use there database import tool.
b) use ssh commands to make database dump or to write databases directly in
mysql via ssh. Commands below.
Create a database dump:
mysqldump DBname --add-drop-table -h DBhostname -u DBusername -pPASSWORD > databasefile.sql
Write a database to mysql:
mysql -h rdbms -u DBusername -pPASSWORD DBname < databasefile.sql
Best solution for this error when i tried some points.
Follow this steps to solve this issue:
locate the file [XAMPP Installation Directory]\php\php.ini (e.g. C:\xampp\php\php.ini)
open php.ini in Notepad or any Text editor
locate the line containing max_execution_time and
increase the value from 30 to some larger number (e.g. set: max_execution_time = 90)
then restart Apache web server from the XAMPP control panel
Changing the max_execution_timeout in php.ini. may help with maximum execution error. but sometimes the database is imported correctly but still it shows maximum execution time error, it can be due to some error of xamp.
I was experiencing the same error even after making all changes in php.ini. which is mentioned above and realized that all the things, tables of database were imported and it was working fine but it was still showing the max_execution_timeout error.
Set Only 3 Parameters from php.ini file of your server
A. max_execution_time = 3000000 (Set as per your requirment)
B. post_max_size = 4096M
C. upload_max_filesize = 4096M
Case 1 : If you are Using Xampp, Edit
C:\xampp\phpMyAdmin\libraries\config.default.php
Case 2 : If you are Using Wampp, Edit
c:\wamp64\apps\phpMyAdmin\libraries\config.default.php
Case 3 : If you are Using Laragon, Edit
C:\laragon\etc\apps\phpMyAdmin\libraries\config.default.php
search for $cfg['ExecTimeLimit'] in config.default.php file and make the following changes
$cfg['ExecTimeLimit'] = 0;
After all set, restart your server and import again your database.
Done
You can increase the limit:
ini_set('max_execution_time', 3000);
(Note that this script can cause high memory usage as well, so you probably have to increase that as well)
Other possible solution: Chunk your sql file, and process it as parts. I assume, it is not one big SQL query, is it?
Update: As #Isaac pointed out, this is about PHPMyAdmin. In this case set max_execution_timeout in php.ini. (The location depends on your environment)
The following might help you:
ini_set('max_execution_time', 100000);
And in your mysql - max_allowed_packet=100M in some cases where queries are too long sql also produce and error "MySQL server has gone away";
Change the values to whatever you need.
I have a relatively small store, about 20k skus all simple products. I'm using magento 1.7.2 but had the same problem with all the older versions. I simply cannot export my products to a CSV. Out of memory when running directly from the dataflow profiles in the magento backend and same error when running it from shell.
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 71 bytes) in /home/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 62
I've increased the memory limits and execution times in magentos htaccess to 512m, magentos php.ini to 512m and my VPS php configuration ini to 512mb. it still burns through it in about 4 minutes and runs out of memory.
I'm so confused, my entire database (zipped) is only 28mb! what am I missing to make the magento export all products function work?
Magento dataflow does have a tendency to use massive amounts of memory making exports on large stores difficult. For stores with large product catalogues it is often a lot quicker and easier to write a script to export directly from the database rather than through dataflow.
This might be problem with your .htaccess file(s) aren’t overriding your memory_limit settings globally set in php.ini.
Other option is set memory_limit to unlimited in you index.php for testing. Then you will come to know whether changes in .htaccess is not getting effected or not.
I solved this problem by exporting 500, 1000 or as many as I wanted at a time (with a custom export script).
I made a file that received as parameters $start and $productsToExport. The file took the collection of products, and then used
LIMIT ($start-1)*$productsToExport, $productsToExport
This script only returned the number of products exported.
I made a second, master script that did a recursive AJAX to the first file, with the parameters $start = 0, $productsToExport = 500. When the AJAX was finished, it did the same with $start = 1, and so on, until no products are left.
The advantage of this is that it doesn't overload the server (one ajax is run only after the previous is finished) - and if an error occurs, the script continues. Also thememory_limit and max_execution_time are sa
If by 20k skus you mean 20.000 then this is totally possible. The export is very hungry for memory, unfortunately. I always increase the memory_limit to 2000M in this case and then it takes a while to create the file, but succeeds in the end.
I have changed my upload and post limit options to 8000 M. However, when I try to import a table from a text file that's only 12.4 MB I get an error saying:
You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
Is 8000 M to big?
Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will cause your script to fail.
http://www.php.net/manual/en/ini.core.php#ini.post-max-size
First make sure to check these values in php.ini
max_execution_time
max_input_time
memory_limit
I would also lower your post_max_size and upload_max_size to a more reasonable level (like maybe 128 or 256M)
Also if you really need to get the data in, you could do it from the command line
mysql -u username -p database < dump.sql
copy and pasted below from: http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/
It's how i overcome the exact same issue.
When trying to import large SQL files into mysql using phpmyadmin, the
phpmyadmin documentation offers a few solutions, but I find the
easiest method to overcome this is…
Find the config.inc.php file located in the phpmyadmin directory. In
my case it is located here: ? 1
C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php
Find the line with $cfg['UploadDir'] on it and update it to: ? 1
$cfg['UploadDir'] = 'upload';
Create a directory called ‘upload’ within the phpmyadmin directory. ?
1 C:\wamp\apps\phpmyadmin3.2.0.1\upload\
Then place the large sql file that you are trying to import into the
new upload directory. Now when you go onto the db import page within
phpmyadmin console you will notice a drop down present that wasn’t
there before – it contains all of the sql files in the upload
directory that you have just created. You can now select this and
begin the import.
If you’re not using WAMP on Windows, then I’m sure you’ll be able to
adapt this to your environment without too much trouble.
I believe the problem is that you have exceeded the 3.2 GB limit (8,000 MB) imposed by a 32 bit process, with PHP. As such, you likely can not use the full 8,000 MB as you have specified. I have had PHP hang on code when processing close to 2000 MB as memory to use with a 32 bit PHP.
I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for report generation.
The client POS is based on PHPPOS, and I have implemented a module that uses the standard XML-RPC library to send sales data to the service. The server system is built on CodeIgniter, and uses the XML-RPC and XML-RPCS libraries for the webservice component. Whenever I send a lot of sales data (as little as 50 rows from the sales table, and individual rows from sales_items pertaining to each item within the sale) I get the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)
128M is the default value in php.ini, but I assume that is a huge number to break. In fact, I have even tried setting this value to 1024M, and all it does is take a longer time to error out.
As for steps I've taken, I've tried disabling all processing on the server-side, and have rigged it to return a canned response regardless of the input. However, I believe the problem lies in the actual sending of the data. I've even tried disabling the maximum script execution time for PHP, and it still errors out.
Changing the memory_limit by ini_set('memory_limit', '-1'); is not a proper solution. Please don't do that.
Your PHP code may have a memory leak somewhere and you are telling the server to just use all the memory that it wants. You wouldn't have fixed the problem at all. If you monitor your server, you will see that it is now probably using up most of the RAM and even swapping to disk.
You should probably try to track down the offending code in your code and fix it.
ini_set('memory_limit', '-1'); overrides the default PHP memory limit.
The correct way is to edit your php.ini file.
Edit memory_limit to your desire value.
As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.
If you know why it takes that much and you want to allow it set memory_limit = 512M or higher and you should be good.
The memory allocation for PHP can be adjusted permanently, or temporarily.
Permanently
You can permanently change the PHP memory allocation two ways.
If you have access to your php.ini file, you can edit the value for memory_limit to your desire value.
If you do not have access to your php.ini file (and your webhost allows it), you can override the memory allocation through your .htaccess file. Add php_value memory_limit 128M (or whatever your desired allocation is).
Temporary
You can adjust the memory allocation on the fly from within a PHP file. You simply have the code ini_set('memory_limit', '128M'); (or whatever your desired allocation is). You can remove the memory limit (although machine or instance limits may still apply) by setting the value to "-1".
It's very easy to get memory leaks in a PHP script - especially if you use abstraction, such as an ORM. Try using Xdebug to profile your script and find out where all that memory went.
When adding 22.5 million records into an array with array_push I kept getting "memory exhausted" fatal errors at around 20M records using 4G as the memory limit in file php.ini. To fix this, I added the statement
$old = ini_set('memory_limit', '8192M');
at the top of the file. Now everything is working fine. I do not know if PHP has a memory leak. That is not my job, nor do I care. I just have to get my job done, and this worked.
The program is very simple:
$fh = fopen($myfile);
while (!feof($fh)) {
array_push($file, stripslashes(fgets($fh)));
}
fclose($fh);
The fatal error points to line 3 until I boosted the memory limit, which
eliminated the error.
I kept getting this error, even with memory_limit set in php.ini, and the value reading out correctly with phpinfo().
By changing it from this:
memory_limit=4G
To this:
memory_limit=4096M
This rectified the problem in PHP 7.
You can properly fix this by changing memory_limit on fastcgi/fpm:
$vim /etc/php5/fpm/php.ini
Change memory, like from 128 to 512, see below
; Maximum amount of memory a script may consume (128 MB)
; http://php.net/memory-limit
memory_limit = 128M
to
; Maximum amount of memory a script may consume (128 MB)
; http://php.net/memory-limit
memory_limit = 512M
When you see the above error - especially if the (tried to allocate __ bytes) is a low value, that could be an indicator of an infinite loop, like a function that calls itself with no way out:
function exhaustYourBytes()
{
return exhaustYourBytes();
}
Your site's root directory:
ini_set('memory_limit', '1024M');
After enabling these two lines, it started working:
; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
; http://php.net/realpath-cache-size
realpath_cache_size = 16k
; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; http://php.net/realpath-cache-ttl
realpath_cache_ttl = 120
Rather than changing the memory_limit value in your php.ini file, if there's a part of your code that could use a lot of memory, you could remove the memory_limit before that section runs, and then replace it after.
$limit = ini_get('memory_limit');
ini_set('memory_limit', -1);
// ... do heavy stuff
ini_set('memory_limit', $limit);
In Drupal 7, you can modify the memory limit in the settings.php file located in your sites/default folder. Around line 260, you'll see this:
ini_set('memory_limit', '128M');
Even if your php.ini settings are high enough, you won't be able to consume more than 128 MB if this isn't set in your Drupal settings.php file.
Change the memory limit in the php.ini file and restart Apache. After the restart, run the phpinfo(); function from any PHP file for a memory_limit change confirmation.
memory_limit = -1
Memory limit -1 means there is no memory limit set. It's now at the maximum.
Just add a ini_set('memory_limit', '-1'); line at the top of your web page.
And you can set your memory as per your need in the place of -1, to 16M, etc..
For Drupal users, this Chris Lane's answer of:
ini_set('memory_limit', '-1');
works but we need to put it just after the opening
<?php
tag in the index.php file in your site's root directory.
PHP 5.3+ allows you to change the memory limit by placing a .user.ini file in the public_html folder.
Simply create the above file and type the following line in it:
memory_limit = 64M
Some cPanel hosts only accept this method.
Crash page?
(It happens when MySQL has to query large rows. By default, memory_limit is set to small, which was safer for the hardware.)
You can check your system existing memory status, before increasing php.ini:
# free -m
total used free shared buffers cached
Mem: 64457 63791 666 0 1118 18273
-/+ buffers/cache: 44398 20058
Swap: 1021 0 1021
Here I have increased it as in the following and then do service httpd restart to fix the crash page issue.
# grep memory_limit /etc/php.ini
memory_limit = 512M
For those who are scratching their heads to find out why on earth this little function should cause a memory leak, sometimes by a little mistake, a function starts recursively call itself for ever.
For example, a proxy class that has the same name for a function of the object that is going to proxy it.
class Proxy {
private $actualObject;
public function doSomething() {
return $this->actualObjec->doSomething();
}
}
Sometimes you may forget to bring that little actualObjec member and because the proxy actually has that doSomething method, PHP wouldn't give you any error and for a large class, it could be hidden from the eyes for a couple of minutes to find out why it is leaking the memory.
I had the error below while running on a dataset smaller than had worked previously.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in C:\workspace\image_management.php on line 173
As the search for the fault brought me here, I thought I'd mention that it's not always the technical solutions in previous answers, but something more simple. In my case it was Firefox. Before I ran the program it was already using 1,157 MB.
It turns out that I'd been watching a 50 minute video a bit at a time over a period of days and that messed things up. It's the sort of fix that experts correct without even thinking about it, but for the likes of me it's worth bearing in mind.
In my case on mac (Catalina - Xampp) there was no loaded file so I had to do this first.
sudo cp /etc/php.ini.default /etc/php.ini
sudo nano /etc/php.ini
Then change memory_limit = 512M
Then Restart Apache and check if file loaded
php -i | grep php.ini
Result was
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Finally Check
php -r "echo ini_get('memory_limit').PHP_EOL;"
Using yield might be a solution as well. See Generator syntax.
Instead of changing the PHP.ini file for a bigger memory storage, sometimes implementing a yield inside a loop might fix the issue. What yield does is instead of dumping all the data at once, it reads it one by one, saving a lot of memory usage.
The reason for this error is that your server configuration has a very low memory limit. Try adding this to wp-config.php (put it after <?php in this file):
define('WP_MEMORY_LIMIT', '96M');
Please note that this limit is OK for the theme and the plugins that come with the theme. If you want to enable other plugins you may need to increase the limit further.
define('WP_MEMORY_LIMIT', '256M');
Running the script like this (cron case for example): php5 /pathToScript/info.php produces the same error.
The correct way: php5 -cli /pathToScript/info.php
If you're running a WHM-powered VPS (virtual private server) you may find that you do not have permissions to edit PHP.INI directly; the system must do it. In the WHM host control panel, go to Service Configuration → PHP Configuration Editor and modify memory_limit:
I find it useful when including or requiring _dbconnection.php_ and _functions.php in files that are actually processed, rather than including in the header. Which is included in itself.
So if your header and footer is included, simply include all your functional files before the header is included.
Greetings is a very common problem because if you have very little memory allocated to php and your website is growing will require more resources.
I found myself in a site that had problems that gave error 500 to modify only some products, the problem was that they had used very heavy images in those specific products, solution:
1.- Increase "memory_limit" in php.ini
2.- Lower the weight of the images.
3.- Adapt again "memory_limit" to an acceptable value "512M" at least for me more than enough.
now it is important that you verify that the changes are being made because php apart from having several versions and several types of installations on the server, maybe you modify one and it does not work and this is because you are not modifying the correct php.ini file.
How do you verify that you are modifying the correct file?
In the prestashop dashboard go to advanced settings/information there you can see "Memory limit".
always remember that after making a change in the php.ini file it is advisable to restart apache or Nginx.
Ubuntu: sudo services apache2 restart
IMPORTANT NOTE: Never set the "memory_limit = -1" as many people mention here. The problem is that if you have a problem with a file or module you could be in a continuous loop consuming all the server's memory and processor. Let's take a simple example: a module has an error and makes a call to a function and until it is not positive it keeps calling, this will create an infinite loop and it will never stop doing it because php has no limit.
I hope it helps colleagues who have this problem.
The most common cause of this error message for me is omitting the "++" operator from a PHP "for" statement. This causes the loop to continue forever, no matter how much memory you allow to be used. It is a simple syntax error, yet is difficult for the compiler or runtime system to detect. It is easy for us to correct if we think to look for it!
But suppose you want a general procedure for stopping such a loop early and reporting the error? You can simply instrument each of your loops (or at least the innermost loops) as discussed below.
In some cases such as recursion inside exceptions, set_time_limit fails, and the browser keeps trying to load the PHP output, either with an infinite loop or with the fatal error message which is the topic of this question.
By reducing the allowed allocation size near the beginning of your code you might be able to prevent the fatal error, as discussed in the other answers.
Then you may be left with a program that terminates, but is still difficult to debug.
Whether or not your program terminates, instrument your code by inserting BreakLoop() calls inside your program to gain control and find out what loop or recursion in your program is causing the problem.
The definition of BreakLoop is as follows:
function BreakLoop($MaxRepetitions=500,$LoopSite="unspecified")
{
static $Sites=[];
if (!#$Sites[$LoopSite] || !$MaxRepetitions)
$Sites[$LoopSite]=['n'=>0, 'if'=>0];
if (!$MaxRepetitions)
return;
if (++$Sites[$LoopSite]['n'] >= $MaxRepetitions)
{
$S=debug_backtrace(); // array_reverse
$info=$S[0];
$File=$info['file'];
$Line=$info['line'];
exit("*** Loop for site $LoopSite was interrupted after $MaxRepetitions repetitions. In file $File at line $Line.");
}
} // BreakLoop
The $LoopSite argument can be the name of a function in your code. It isn't really necessary, since the error message you will get will point you to the line containing the BreakLoop() call.
In my case it was a brief issue with the way a function was written. A memory leak can be caused by assigning a new value to a function's input variable, e.g.:
/**
* Memory leak function that illustrates unintentional bad code
* #param $variable - input function that will be assigned a new value
* #return null
**/
function doSomehting($variable){
$variable = 'set value';
// Or
$variable .= 'set value';
}
Increasing the memory_limit fixed the problem. However, I had problems finding the memory limit. I am working on my project directly from live server, so if you're doing the same, on cPanel you can find the memory_limit if you go to Software - MultiPHP INI Editor and select the location. I increased mine from 256M to 512M. You can also find instructions here.