Slim 3.1 ubuntu服务器错误

时间:2017-07-17 03:40:35

标签: php ubuntu slim

将Slim 3应用程序部署到Ubuntu服务器时收到以下服务器错误。

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

我将logs目录的权限设置为可写,但仍无法正常工作。

1 个答案:

答案 0 :(得分:2)

Web服务器用户仍无法写入/var/www/html/api/search-api/src/logs中的日志目录。

尝试:

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

这假设您的网络服务器作为www-data用户运行,该用户有一个名为www-data的组。