WP-CLI unable to recongnise PHP server / environment variables on Ubuntu

You would need to define the global URL parameter in wp-cli.yml or in the command like --url=https://example.com