Can't load database credentials when running php artisan config:cache
reneroboter opened this issue · comments
- Themosis Version: master
- WordPress Version: 5.8.1
- PHP Version: 8.0.10
Description
WordPress uses constants to instantiate the WordPress database abstraction object (wpdb). Currently the constants where defined in the config/wordpress.php
file. The Laravel deployment guide advice to run php artisan config:cache
for optimising loading config files. However when your config files where cached (bootstrap/cache/config.php
) Themosis will not call config/wordpress.php
again and the required constants (DB_NAME etc
) e.g. for wpdb will not defined at runtime and your WordPress instance is crashing.
Steps to reproduce
php artisan config:cache
- Call your local project
Expected behavior
@jlambe my exception is that I can run php artisan config:cache
and my Themosis instance is working. I don't have a good solution, but I share some thoughts to this issue :)
Hello @reneroboter, a recent patch has been added to the master
branch that should fix this. Could you please update your project and let us know how it goes ?
@jlambe it works and can be closed now :)