问题描述
我在请求sorial/app_dev.php
时得到了这个信息:
Im getting this when requesting sorial/app_dev.php
:
Not Found
The requested URL /app_dev.php/ was not found on this server.
当请求sorial/app.php
时:
我在Ubuntu 14.04和Apache 2.4上
Im on Ubuntu 14.04 and Apache 2.4
编辑:这是我的虚拟主机:
This is my virtual host:
<VirtualHost *:80>
ServerName sorial
#ServerAlias sorial.es
DocumentRoot /var/www/sorial/web
DirectoryIndex app.php
#SetEnv SYMFONY__DATABASE__PASSWORD jander
<Directory /var/www/sorial/web/>
# Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Order allow,deny
#allow from all
Require all granted
FallbackResource /index.php
# BEGIN EXPIRES
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/plain "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
# END EXPIRES
</Directory>
</VirtualHost>
我的文档根目录位于/var/www/sorial/web
.
事实是,我的其他网站也遇到相同的问题.当我尝试使用a2dismod env
禁用/启用env_mod
时,问题开始了,因为添加变量SetEnv
(如您在虚拟主机中所见)时,我得到了
The truth is I have the same problem for the rest of my sites. The problem started when I try to disable/enable env_mod
using a2dismod env
, since when adding the variable SetEnv
(as you can see in my virtual host) I was getting
重新启动apache时.
when restarting apache.
推荐答案
我终于解决了我的问题,安装了php5和libapache2-mod-php5,如下所示:sudo apt-get install php5 libapache2-mod-php5
I finally solved my problem installing php5 and libapache2-mod-php5 like this: sudo apt-get install php5 libapache2-mod-php5
这篇关于Symfony 3.1:请求app_dev.php或app.php时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!