Search code examples
amazon-web-serviceslaravel-5amazon-elastic-beanstalkdatabase-migrationlaravel-artisan

PHP Fatal Error on 'php artisan migrate' on remote AWS EB instance: laravel.log: Permission denied


When I SSH into my AWS EB instance to run php artisan migrate, I get the following error message:

Link to bigger size of picture below

php fatal error on running php artisan migrate on eb instance

I am completely confused. First, I don't get this error on the local server. Second, what does a simple log file have to do with migrations anyway? They are ignored by git by default, so no log files are uploaded.

Sigh... Any ideas on how I can be allowed to run my php artisan migrate?


Solution

  • It's always the storage folder. Blank pages or permission denied, it's the darn storage folder.

    I don't know how EB works, if it's a regular distro or what, but you should change ownership of the storage folder to the web server (www-data most likely) so it can build the views then set 775 permission so you can write/read logs.

    So something like:

    sudo chown -R www-data:www-data storage/
    sudo chmod -R 775 storage/