1

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?

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145
MartinJH
  • 2,590
  • 5
  • 36
  • 49
  • 2
    It's trying to write something to the log folder, for which the permissions are not set up correctly. – Kryten May 29 '15 at 21:24
  • Aha. Now I'm that much smarter. You wouldn't happen to know how to allow the application to write to the log? Thanks for your time by the by :) – MartinJH May 29 '15 at 22:12

2 Answers2

1

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/
hfingler
  • 1,931
  • 4
  • 29
  • 36
  • 2
    You were right. Damn storage folder was the culprit. It worked when I did the following command: `sudo chmod -R ugo+rw storage` – MartinJH May 30 '15 at 10:15
1

I've gone through the same error

enter image description here

As stated here,

AWS AMI uses webapp as the web user, not apache or ec2-user as the file shows. In that case, the webapp user has no access rights over those files.

So, going through the steps mentioned in there fixed the problem

sudo chown $USER:webapp ./storage -R

find ./storage -type d -exec chmod 775 {} \;

find ./storage -type f -exec chmod 664 {} \;

Depending on what you're aiming to do afterwards you might need to go through this too.

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145