composer require
is the command to add packages to a composer project. Dreamhost shared hosting kills this command for using too much memory. To install new packages on Dreamhost shared hosting,
- copy the project to another machine,
- run
composer require
on that machine, - copy the composer.lock file back to Dreamhost shared hosting, and
- run
composer install
on Dreamhost.
Thanks to srosato on the Dreamhost forums.