Symfony没有加载页面 [英] Symfony doesn't load a page

查看:94
本文介绍了Symfony没有加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Ubuntu Server中配置了Symfony 3.4.15,并且欢迎"页面可以使用,但是当我想用Controller创建新页面(例如/home)时,它不起作用:

I just configured Symfony 3.4.15 in my Ubuntu Server and the Welcome page works, but when I want to create a new page, for example /home, with a Controller it doesn't work:

未找到

在此服务器上找不到请求的URL/home. Apache/2.4.18(Ubuntu)服务器位于167.99.90.60端口80

The requested URL /home was not found on this server. Apache/2.4.18 (Ubuntu) Server at 167.99.90.60 Port 80

我已按照Symfony文档中的所有步骤进行操作,但是它不起作用...

I follow all the steps in the Symfony Documentation, but it doesn't work...

我读到该问题是由我的Apache2配置引起的,但我不知道如何解决它.

I read that the problem is caused for my Apache2 configuration, but I don't know how to solve it.

我在Ubuntu服务器中安装了LAMP.

I have LAMP installed in my Ubuntu Server.

apache2配置如下:

The apache2 configuration is something like this:

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/my-project/public>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>

这是我的虚拟主机文件配置:

Here's my Virtual Host file configuration:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname $
        # the server uses to identify itself. This is used when creat$
        # redirection URLs. In the context of virtual hosts, the Serv$
        # specifies what hostname must appear in the request's Host: $
        # match this virtual host. For the default virtual host (this$
        # value is not decisive as it is used as a last resort host r$
        # However, you must set it for any further virtual host expli$
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/my-project/public

        # Available loglevels: trace8, ..., trace1, debug, info, noti$
        # 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 ex$
        # following line enables the CGI configuration for this host $
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

有什么主意吗?

推荐答案

问题是我忘记在de/public文件夹中创建我的.htaccess文件.

The problem was that I forgot to create my .htaccess file inside de /public folder.

这篇关于Symfony没有加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆