0

I have a memory_limit problem and a max execution time problem doing a complex query in a huge database.

The easy way to solve it would be to increase the value of these parameters in php.ini, but I have been reading and it's not recommended and splitting the query is not possible too.

So, are there any way to modify these parameters or increase their just for some requests?

Thanks

1 Answers1

0

you can use ini_set function for this, It sets the value of the given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.

ini_set('memory_limit','16M');
ini_set('max_execution_time', 300);

Read here regarding description of core php.ini directives

TIGER
  • 2,864
  • 5
  • 35
  • 45