I got Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 91 bytes) error while trying to backup database on online rest server using Codeigniter dbutil backup() function.
Here is my code:
$this->load->dbutil();
$backup =& $this->dbutil->backup();
$this->load->helper('file');
write_file('./uploads/db/mybackup.gz', $backup);
I can't find out where I am doing wrong.
$output.= 'insert into...';and then writing the output to the disk. - MonkeyZeus/system/database/drivers/mysql/mysql_utility.phpand find the function_backup()to see exactly why your memory is being exhausted. The issue is that the utility is not streaming the data to a file but it is trying to load all of the bytes into memory. - MonkeyZeus