↑ ↓ select, Enter open, Esc close

Run a PHP script once without a memory limit

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
php -d memory_limit=-1 /var/www/vhosts/example.com/httpdocs/import.php

Uses -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

Related one-liners

All in PHP

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.