Deploying a Laravel App via Elastic Beanstalk | Amazon Web Services BASICS
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they followed to deploy Laravel on Elastic Beanstalk, usually when they hit problems with migrations, routes returning 404 or database host settings.
Recommended by 2 people across 2 different months, 2018 to 2020.
What it is
A 28-minute walkthrough by Maximilian Schwarzmuller of Academind showing how to deploy a Laravel blog app with a database to AWS Elastic Beanstalk. It covers the EB CLI, .ebextensions config files and connecting an RDS database.
What people said
Recommends Guilherme Souza · 2018-11 · Stack Overflow · on “Running Laravel's migration command on AWS Elastic Beanstalk”
I'm having a hard time deploying a Laravel app for test purposes on AWS Elastic Beanstalk. Followed all sources i could find in web including AWS documentation. Created a Elastic Beanstalk environment and uploading an application is straightforward as long as i do not include .ebextensions and the .yaml file in it. Based on Maximilian's [this video] tutorial i created init.config file inside .ebextensions with contents: container_commands: 01initdb: command: "php artisan migrate" Environment gets to a degraded state as it finishes to update and i get the following logs: [2018-11-20T23:14:08.485Z] INFO [7969] : Command processor returning results: {"status":"FAILURE","api_version":"1.0","results":
Recommends Furqan S. Mahmoud · 2020-05 · Stack Overflow · on “Laravel with Elasticbeanstalk: All the routes return 404 except for '/' route”
I need to deploy really simple laravel 7 application to Elasticbeanstalk, I did everything just like this tutorial [this video] Everything is going fine until I click on any other route except for the / route. [LINK] (working) [LINK] (Not working) web.php Route::get('/', function () { return view('welcome'); }); Route::get('/experts', 'ExpertsController@index'); Route::get('/experts/{id}/show', 'ExpertsController@show'); Route::get('/experts/{id}/book', 'AppointmentsController@display'); Route::post('/appointment/{id}', 'AppointmentsController@store'); .htaccess <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization H
Cites Furqan S. Mahmoud · 2019-08 · Stack Overflow · on “Problem with executing laravel migrations on Elastic Beanstalk”
I deployed my laravel application using Elastic beanstalk, and I need to execute php artisan:migrate command on the remote database. Based on Maximilian's [this video] tutorial I created init.config file inside .ebextensions with contents: container_commands: 01initdb: command: "php artisan migrate" The status of the deployment is Healthy, but it didn't create any table! any clues, please?
Cites I. Antonov · 2019-09 · Stack Overflow · on “"Database hosts array is empty." after deploying Laravel project on AWS Elastic Beanstalk”
I deployed my project to an AWS EC2 instance using Elastic Beanstalk. I used this tutorial [this video] [this video] as a reference while deploying. I am following everything as it is in the tutorial but I ended up with an error. Database hosts array is empty. (SQL: select * from resource_categories ) The following are my codes. database.php <?php define('RDS_HOSTNAME', $_SERVER['RED_HOSTNAME']); define('RDS_USERNAME', $_SERVER['RED_USERNAME']); define('RDS_PASSWORD', $_SERVER['RED_PASSWORD']); define('RDS_DB_NAME', $_SERVER['RED_DB_NAME']); return [ 'default' => env('DB_CONNECTION', 'mysql'), 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('databa
Cites Razor · 2020-03 · Stack Overflow · on “Laravel upload to AWS EB migration:No migrations”
I'm looking for some help with Laravel. I have run php artisan migrate:fresh But only the migrations table is created and gives me the No Migrations message. I have a number of migration files in Database/migrations. Any ideas what has gone wrong? This is all working fine in mt WAMP environment. I am trying to upload it to an AWS EB instance I have downloaded the code as a zip from the remote repository. unzipped run composer instal edited the .env and database config and created the .ebextensions folder with init.config file containing: container_commands: 01-initkey: command: "php artisan key:generate" 02-migration: command: "php artisan migrate" leader_only: true The commands seem to run
Cites Nico Anastasio · 2020-05 · Stack Overflow · on “404 on Laravel Elastic BeanStalk”
I am trying to deploy a Laravel 7 application to Elastic BeanStalk but having some problem with the routing. I have followed the tutorial from the video below and upload the zip archive with all my local files. I have also fixed the permission issue after having set the root to /public. Currently, the only page visible is the homepage whereas al the other pages like /login, /register and the other show me a 404 here is the log of the from eb: 2020/05/01 14:19:30 [error] 4091#0: *4 open() "/var/www/html/public/login" failed (2: No such file or directory), client: 82.4.194.3, server: , request: "GET /login HTTP/1.1" [this video]
Cites Zmuffin · 2020-05 · Stack Overflow · on “Laravel Route not working after I deployed in Beanstalk AWS”
I follow different article and tutorial video for deploying Laravel 5.6 in AWS Beanstalk. All the config are done; adding database (mysql) and upload zip file. Problem is, it shows 404 error in every route except "/" i.e root (aka website link). It shows first page or root page but does not show other route pages . Error Screenshots Root Page (print env) [LINK] Other route like (api) [LINK] Instruction and tutorial I followed: [this video] [LINK] (EC2 Instance) [LINK] [LINK] (official tutorial) [LINK] (EB CLI) [LINK] Edit: Solution for the problem is in this link Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1 [LINK] Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1 [LINK] [
Cites Tiago Peres · 2020-12 · Stack Overflow · on “AWS EB undefined RDS_HOSTNAME with Database hosts array empty”
I just tested that way with the .ebextensions folder (as explained here [this video] ) but the instance then got into a degraded state. So ideally I'd SSH into the instance and run the command when needed.