0

Here is the situation, I'm trying to install wp-cli with Homebrew as following:

brew install wp-cli

But during the installation process, the following error occurs:

PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 29889 bytes) in Unknown on line 0

Homebrew first download the appropriate package:

==> Downloading https://github.com/wp-cli/wp-cli/archive/v0.18.0.tar.gz

And then the process use Composer to proceed the installation:

==> /usr/local/bin/composer install

That causes the above PHP Error and I haven't find any solution to fix this problem (I followed the instructions described here but no success).

I understand the error message and tried to increase the memory limit in the php.ini file (I also tried 1G):

memory_limit = 512M

But without any success even after having restarted the server in order to be sure that my modification was taken into account.

Here are some information about my configuration:

> php -v
PHP 5.5.23 (cli) (built: Mar 23 2015 01:47:37)

> brew -v
Homebrew 0.9.5

> composer -v
Composer version 1.0-dev (f10c71475167a4661225b14560ca0a400d730829) 2015-03-29 14:37:42

> php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini

Thinking about a memory overload, I also cleaned the cache of Composer with the following command (because error message occurs during the composer install process):

> composer clearcache

That was still useless in my situation, of course every used tools are up-to-date:

> brew update
> brew upgrade
> composer selfupdate

I probably missed something simple but I didn't find the cause of my problem.

Community
  • 1
  • 1
Joël Salamin
  • 3,538
  • 3
  • 22
  • 33
  • Are you 100% sure that it's the right php.ini file? Sometimes (even when you explicitly state the file or see a configuration print out the file) there is ANOTHER version of the file somewhere that is overriding your configurations. – Commander Apr 07 '15 at 19:39
  • Isn't it enough to check the used file with the command `php --ini`? How can I ensure that the system isn't using a configuration from another `php.ini` ? – Joël Salamin Apr 07 '15 at 19:41
  • It should be enough. And it might be enough depending on your system. But I've had issues on linux, windows, and mac where the php.ini file wasn't the right one or there was another one somewhere that was overriding configurations on me. Do a search for any files named php.ini on your system. If there are any others then change a value and check php to see which one is the right one. – Commander Apr 07 '15 at 19:44
  • Thank you for the advice, I'm trying that now and give you a feedback as soon as every tests are done ;-) – Joël Salamin Apr 07 '15 at 19:51
  • I used the `grep` command to find every `php.ini` files on my system and tried to change the memory limit. This doesn't solve the problem... – Joël Salamin Apr 08 '15 at 06:59

0 Answers0