WP-CLI and phprc?

Per wiki instructions I’ve created /home/myuser/.php and maintain a folder there for each version of PHP used by my sites. I saw v7.1 is available so updated my phprc file there with desired values and changed the PHP version being used for one of my WordPress sites through my dashboard to 7.1.

I know the site is using the configs:

  • It reports using PHP 7.1.7
  • If I don’t set the PHP Memory limit, it defaults to 256MB. I set phprc with a wishful memory_limit=512M and on refreshing WP it shows that value.

From shell, WP-CLI showed PHP 5.6 and a related php.ini.

To change the version of PHP at shell, I used the related doc.

Now WP-CLI shows PHP v7.1.7 and a related /etc/php71/php.ini.

To the question… How do we get WP-CLI to use the phprc file so that it runs with the same settings as the site?


I am not sure why WP-CLI doesn’t seem to use the phprc settings. That shouldn’t be an issue though and everything should work just fine, even if the PHP CLI version is different. If this is causing issues, we may need to investigate deeper into your account: can you please open a ticket?

Glad to have found what may be a real anomaly. Yes I’ll open a new ticket.

As you can see in my other recent post, I’m looking to optimize WordPress and I want to make sure the tools are working properly.

Comments there from you and your colleagues would be Most appreciated.