I am trying to run a Symfony4 app on production and I am getting the following error:
Uncaught TypeError: Return value of Symfony\\Component\\Dotenv\\Dotenv::populate()
must be an instance of Symfony\\Component\\Dotenv\\void,
none returned in /var/www/html/vendor/symfony/dotenv/Dotenv.php:95
Stack trace:
#0 /var/www/html/vendor/symfony/dotenv/Dotenv.php(57):
Symfony\\Component\\Dotenv\\Dotenv->populate(Array)
#1 /var/www/html/public/index.php(12):
Symfony\\Component\\Dotenv\\Dotenv->load('/var/www/html/s...')
#2 {main}
thrown in /var/www/html/vendor/symfony/dotenv/Dotenv.php on line 95
On local the app is running fine. Once it moves to production, it breaks.
Any idea why this might be happening?
And is production running PHP5.x, or 7.0? The void return type is only available/reserved from PHP 7.1, and so it would think it could be a class in the same namespace - which does not exist either. Symfony 4 requires PHP 7.1.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With