teej2542
teej2542

Reputation: 608

Slim 3.1 ubuntu server error

Receiving the following server error when deploying Slim 3 application to Ubuntu server.

Slim Application Error
The application could not run because of the following error:

Details

Type: UnexpectedValueException
Message: The stream or file "/var/www/html/api/search-
api/src/../logs/app.log" could not be opened: failed to open 
stream:Permission denied
File: /var/www/html/api/search-
api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
Line: 107

I set the permission the logs directory to be writable, but still not working.

Upvotes: 2

Views: 1250

Answers (1)

Rob Allen
Rob Allen

Reputation: 12778

The logs directory in /var/www/html/api/search-api/src/logs is still not writable by the web server user.

Try:

cd var/www/html/api/search-api/src/
sudo chgrp -R www-data logs
sudo chmod -R g+rws logs

This assumes that your web server is running as the www-data user which has a group called www-data.

Upvotes: 4

Related Questions