Run a PHP script once without a memory limit
allowed memory size exhausted | increase php memory limit for one script | change memory_limit temporarily | php | php-ini | memoryCaution: This command changes the system. Understand what it does before you run it.
php -d memory_limit=-1 /var/www/vhosts/example.com/httpdocs/import.phpUses -d to override an ini setting for this one call only, here the memory limit. Helps with imports, migrations or Composer runs that abort with “Allowed memory size exhausted”. The permanent configuration stays unchanged.
Note: An unlimited value can let a faulty script consume all available RAM. A fixed value such as 1024M is the better choice.
Also searched as
- allowed memory size exhausted
- increase php memory limit for one script
- change memory_limit temporarily