I’m attempting to deploy a Laravel 8 app that uses a managed MySQL database to App Platform but seeing this error during deployment:
2023-01-08T16:12:58.283405616Z [34m│[0m > Illuminate\Foundation\ComposerScripts::postAutoloadDump
2023-01-08T16:12:58.365340624Z [34m│[0m > @php artisan package:discover --ansi
2023-01-08T16:13:01.437590868Z [34m│[0m
2023-01-08T16:13:01.461467698Z [34m│[0m In Connection.php line 712:
2023-01-08T16:13:01.461502691Z [34m│[0m
2023-01-08T16:13:01.461505582Z [34m│[0m Undefined variable $host (SQL: select * from information_schema.tables wher
2023-01-08T16:13:01.461507874Z [34m│[0m e table_schema = website and table_name = errors and table_type = 'BASE TAB
2023-01-08T16:13:01.461522132Z [34m│[0m LE')
2023-01-08T16:13:01.461527037Z [34m│[0m
2023-01-08T16:13:01.461529776Z [34m│[0m
2023-01-08T16:13:01.466120248Z [34m│[0m In MySqlConnector.php line 154:
2023-01-08T16:13:01.466140089Z [34m│[0m
2023-01-08T16:13:01.466143440Z [34m│[0m Undefined variable $host
2023-01-08T16:13:01.466146446Z [34m│[0m
2023-01-08T16:13:01.466150226Z [34m│[0m
I’ve added the database to the app which set the DATABASE_URL environment variable and configured the trusted source. The app runs fine locally and can connect to this database without issue.
Any idea what I’ve missed?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi @scottmetoyer,
Can you please post the Environment Variables you’ve configured on your App Platform?
If unsure, you can follow this Doc on how to define them :
https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/