早安StackOverFlow ..我已经解决了这个问题很长一段时间。
问题:当我尝试访问http://newdash.new时,它会返回500错误。在本地和通过LAN访问URL时都会发生这种情况。
使用Apache 2.4.10在Debian8上运行 以下是我的
/etc/apache2/sites-enabled/newdash.conf
下面:
<VirtualHost *:80>
ServerName newdash.new
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/newdash/public"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/newdash/public">
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>
</VirtualHost>
和权限:
drwxr-xr-x 11 root root 4096 Nov 13 10:51 newdash
我可以在本地和局域网上ping命名路由(newdash.new),并且ip可以正常解析。
在我的Apache2错误日志中:
[Fri Nov 13 11:45:51.345101 2015] [:error] [pid 1958] [client 10.1.1.108:56899] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/newdash/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/newdash/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/newdash/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\\Handler\\StreamHandler->write(Array)\n#1 /var/www/newdash/vendor/monolog/monolog/src/Monolog/Logger.php(289):
所以看来该目录上存在权限错误..
我不知道其他哪些信息会有所帮助...
谢谢。
答案 0 :(得分:0)
我在错误日志中找到了错误。
[Fri Nov 13 11:45:51.345101 2015] [:error] [pid 1958] [client 10.1.1.108:56899] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/newdash/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/newdash/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/newdash/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\\Handler\\StreamHandler->write(Array)\n#1 /var/www/newdash/vendor/monolog/monolog/src/Monolog/Logger.php(289):
正如所建议的,在查看之后,我意识到/ storage / logs /文件夹上的权限导致了这些问题。
感谢您提出建议arkascha!