brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp cli info shows which PHP and config files wp is really using

Troubleshooting
~/tips/tip-wordpress-wp-cli-info

wp cli info

Shows the PHP binary, php.ini, memory limit and config files that WP-CLI is using.

When wp behaves differently from the website, the first thing I want to know is which PHP it runs on. The command line often uses another PHP than the web server does.

wp cli info prints details about the WP-CLI environment. The docs call it helpful for diagnostics and list what it shares: operating system, shell, PHP binary and version, PHP memory limit, the php.ini in use, the WP-CLI root directory, the global and project config files and the WP-CLI version.

wp cli info

The output is a list of lines such as PHP binary:, PHP version:, php.ini used: and WP-CLI project config:. For scripts there is a JSON form:

wp cli info --format=json

The php.ini used line is the one I look at first. The docs note that this file is typically different from the one the web server uses, so a memory limit or an extension can be set in the browser’s PHP and missing in the terminal, or the other way round.

The WP-CLI project config line shows where the project config file is located. The WP-CLI global config line does the same for the global one. See the config docs if you want to know how WP-CLI finds them.

The command runs on the before_wp_load hook, just before WordPress starts loading. It describes WP-CLI and PHP, so it says nothing about plugins or the site itself.

Further reading: wp cli info (WP-CLI handbook)

More Troubleshooting tips Get-NetTCPConnection -State Listen modinfo -p usb_storage ps -o pid,lstart,etime,cmd -p 1234 sudo lsof -nP -p 1234 fc-match Helvetica All Troubleshooting tips (21) All topics

Link