1

I am using Lumen for API development and uses Windows box to develop them, while trying to deploy it for testing on a CentOS 7 box I am getting following error:

> Lumen (5.2.5) (Laravel Components 5.2.*) Fatal error: Uncaught
> exception 'ErrorException' with message 'Unknown:
> open(/tmp/sess_256709456767027352b0afedbc9bd91b, O_RDWR) failed:
> Permission denied (13)' in Unknown:0 Stack trace: #0 [internal
> function]:
> Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(2,
> 'Unknown: open(/...', 'Unknown', 0, Array) #1 {main} thrown in Unknown
> on line 0

Lumen by default do not come with config/session.php, so I tried giving custom path by creating a file but no luck so far.

deej
  • 2,536
  • 4
  • 29
  • 51
  • How are you serving your app? – Scopey Apr 07 '16 at 01:20
  • Have you checked the permissions for your Apache user on the `tmp` folder? – Scopey Apr 08 '16 at 01:21
  • Good question, Apache don't have permissions on the tmp folder but this was a whm/cpanel - though I had access to root user I did not want to take any risk so I did below as I answered. – deej Apr 08 '16 at 18:22

1 Answers1

1

Got it! I will have to load the session config by making an entry into the bootstrap/app.php by adding following line:

$app->configure('session');

This would read path I setup in config/session.php, which I changed to /storage/framework/session

I hope this is reliable enough.

deej
  • 2,536
  • 4
  • 29
  • 51