In my dev environment, I try to use the trellis built-in variable wp_cli_packages
to provision my site with and additional wp-cli package, but I get this error :
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2621440 bytes) in
phar:///usr/bin/wp/vendor/composer/composer/src/Composer/Json/JsonFile.php on line 275
I tried increasing the php_memory_limit to 512M, but I still get the same error.
In wordpress backend I can see the php limit has been increased, but if I vagrant ssh
in my dev environment and type :
php --info | grep memory_limit
I get :
memory_limit => 128M => 128M
which seems to be the cause of the issue.
If I try to install the package with :
php -d memory_limit=512M "$(which wp)" package install git@github.com:10up/wp-vulnerability-scanner.git
It works. But this is not an acceptable solution for me as I want to automate this wp-cli package install.
This is what the top of my groups_var/all/main.yml file looks like :
php_memory_limit: 512M
composer_keep_updated: true
apt_cache_valid_time: 3600
apt_package_state: present
apt_security_package_state: latest
apt_dev_package_state: latest
ntp_timezone: Europe/Paris
ntp_manage_config: true
www_root: /srv/www
theme: example-theme
wp_cli_packages: ["git@github.com:10up/wp-vulnerability-scanner.git"]
What am I missing here ?
EDIT: I did reprovision the VM with vagrant provisison
and vagrant reload --provision