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!
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/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.