【发布时间】:2018-01-09 17:52:35
【问题描述】:
我尝试在 app.php 中使用 die() 进行调试,但我看到这一行出现错误。在此行脚本起作用之前。
$response = $kernel->handle($request);
检查日志:
tail /var/log/apache2/error.log
里面没有数据。在检查之前,我删除了这个文件并创建了它,所以它是空的。
虚拟主机:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName 178.62.70.115
ServerAdmin webmaster@localhost
DocumentRoot /var/www/symfony_3_subscribers_in_file_demo/web
<Directory "/var/www/symfony_3_subscribers_in_file_demo/web">
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
如果我去 app_dev.php,那么我得到
您无权访问此文件。检查 app_dev.php 了解更多信息 信息。
我已经清除了这里所说的缓存:
Symfony 3 Apache 500 Internal Server Error
还有什么地方可以寻找问题?顺便说一句,在我的开发机器上它是一样的 - app.php 也给出 500 错误。只有 app_dev.php 有效。
更新
回答评论 - 日志和缓存目录是否可写:
drwxrwxr-x 4 darius darius 4096 Jan 8 10:02 cache
drwxrwxr-x 2 darius darius 4096 Jan 8 10:02 logs
由于每个都有一个减号,因此它们是部分可写的。
【问题讨论】:
-
var/logs、var/cache等目录是否可写? -
@ArtOsi - 部分是的。也许这就足够了。 symfony 安装脚本不是没有处理权限吗?
-
在 3.x 版本中不,您已设置权限
chmod 777 -R var/log/或其他内容