SSHing into production server - works
wp-cli @dev <command>
- works
wp-cli @prod --info
- works
wp-cli @prod plugin list
- returns this error:
Fatal error: Uncaught Dotenv\Exception\InvalidPathException: Unable to read any of the environment file(s) at [/srv/www/website.com/releases/20210624173918/.env]. in /srv/www/website.com/releases/20210624173918/vendor/vlucas/phpdotenv/src/Store/FileStore.php:68
Stack trace:
#0 /srv/www/website.com/releases/20210624173918/vendor/vlucas/phpdotenv/src/Dotenv.php(222): Dotenv\Store\FileStore->read()
#1 /srv/www/website.com/releases/20210624173918/config/application.php(33): Dotenv\Dotenv->load()
#2 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1197) : eval()'d code(7): require_once('/srv/www/website...')
#3 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1197): eval()
#4 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1158): WP_CLI\Runner->load_wordpress()
#5 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
#6 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner->p in /srv/www/website.com/releases/20210624173918/vendor/vlucas/phpdotenv/src/Store/FileStore.php on line 68
Error: Cannot connect over SSH using provided configuration.
I’m using a recent bedrock, which has these versions in composer.json:
"php": ">=7.1",
"composer/installers": "^1.10",
"vlucas/phpdotenv": "^5.3",
"oscarotero/env": "^2.1",
Also a recent trellis. The remote server has this version of wp-cli installed:
~$ wp --version
WP-CLI 2.4.0
This may be a separate issue, but I’m not able to run a wp command on the server without hitting a memory issue so I have to run it with some special addons as was advised in an issue on the trellis repo.
php -dmemory_limit=-1 "$(which wp)" package list
Is it possible to do that via an alias as well? Or is this not the problem.
The .env file on the remote has 600 permissions, is this correct?