WebFaction
Community site: login faq

What is the best way to give a local php (together with drush for a drupal 8) more memory. Its not necessary for the web cgi/fast-cgi process itself, only for local admin tasks.

My solution was to copy your php.ini file from /usr/local/lib/php72/php.ini, set memory_limit and add an alias in my .bash_profile:

alias php='/usr/local/bin/php72 -c /home/beteigeuze/etc/php.ini'
alias drush='/usr/local/bin/php72 -c /home/beteigeuze/etc/php.ini /home/beteigeuze/bin/drush.phar'

is there an better solution?

asked 23 Oct '18, 11:04

marcel
671616
accept rate: 0%

Seems like a reasonable solution to me.

(23 Oct '18, 15:31) seanf

You can also try the -d option, with which you can define an INI entry:

$ php72 -i | grep memory_limit # default
memory_limit => 128M => 128M
$ php72 -d memory_limit=256M -i | grep memory_limit
memory_limit => 256M => 256M

Similarly, you can put that in an alias in your .bash_profile.

permanent link

answered 24 Oct '18, 15:39

iliasr ♦♦
2.0k14
accept rate: 35%

The solution is not 100% working for me. in our enviroment the drush process still does not honor the custom php / or custom memory limit and it complains still that it needs more than 128M. I belive that maybe the drush process itslef starts another php process which does not use the "bash settings", AFAIK.

The solution was to configure drush itself for more memory e.g. ini_set('memory_limit', '512M'); https://support.acquia.com/hc/en-us/articles/360005311613-Increasing-the-memory-limit-for-Drush.

permanent link

answered 15 Nov '18, 16:48

Lotek
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×86
×63
×7
×7

question asked: 23 Oct '18, 11:04

question was seen: 291 times

last updated: 15 Nov '18, 16:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM