Rama
Rama

Reputation: 11

Allow Memory Size Codeigniter 4

I write application with codeigniter 4. but there is problem like Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 473350880 bytes) in C:\my-project\my-app\vendor\codeigniter4\framework\system\ThirdParty\Escaper\Escaper.php on line 147

I've looking for solution, until get to change memory_limit in php.ini file and restart the apache server. but it's not working.

anyone can help me ?

Upvotes: 0

Views: 1982

Answers (1)

You should increase your Memory limit:

  • editing your php.ini file

    memory_limit = 512M

OR

  • including this line on the top of your script

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

You should also check if this lines are on your .htaccess:

php_value memory_limit <value>
php_value upload_max_filesize <value>

Their values override the php configuration. So they should reflect your needs, or simply be removed.

Upvotes: 1

Related Questions