Good afternoon,
I am getting the following error in my docker console (when I try to navigate to my Wordpress site). FYI I’m mapping /bedrock directory to /var/www/html.
tbp-wp-wordpress | NOTICE: PHP message: PHP Fatal error: Uncaught Error: Class 'Env' not found in /var/www/html/config/application.php:30
tbp-wp-wordpress | Stack trace:
tbp-wp-wordpress | #0 /var/www/html/web/wp-config.php(8): require_once()
tbp-wp-wordpress | #1 /var/www/html/web/wp/wp-load.php(42): require_once('/var/www/html/w...')
tbp-wp-wordpress | #2 /var/www/html/web/wp/wp-blog-header.php(13): require_once('/var/www/html/w...')
tbp-wp-wordpress | #3 /var/www/html/web/index.php(6): require('/var/www/html/w...')
tbp-wp-wordpress | #4 {main}
tbp-wp-wordpress | thrown in /var/www/html/config/application.php on line 30
tbp-wp-wordpress | 172.21.0.6 - 12/Aug/2020:21:08:47 +0000 "GET /index.php" 500
To upgrade to Wordpress 5.5, I updated the values to the following in my composer.json and ran composer update.
"require": {
"php": ">=7.4",
"composer/installers": "^1.8",
"vlucas/phpdotenv": "^4.1.8",
"oscarotero/env": "^2.1",
"roots/wordpress": "^5.5",
"roots/wp-config": "1.0.0",
"roots/wp-password-bcrypt": "1.0.0",
"wpackagist-plugin/redis-cache": "^2.0",
"wpackagist-theme/twentytwenty": "^1.4",
"wpackagist-plugin/elementor": "^2.9",
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5.6",
"roave/security-advisories": "dev-master"
},
Line 30 in application.php is:
Env::init();
Things I have tried:
- First time updating to WP 5.5 I used composer update
- After encountering the error, and after reading the forums I deleted the /vendor directory and the /wp directory inside bedrock, and ran composer create-project
- To confirm that the .env file was present, I entered my wordpress docker container and it was there
Any help or suggestions would be appreciated!
Thank you!