Symfony的2全新安装没有URL作品 [英] Symfony 2 fresh install no url works

查看:282
本文介绍了Symfony的2全新安装没有URL作品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我知道你会认为它浑身许多其他类似的话题。但是,请多多包涵了一会儿。我读过有关

等话题

未找到GET /

路线

但我的问题是不同的。它适用于其他的程序员时,他们使用的URL / app_dev.php,同时使用URL / app.php不仅工作。对我来说,他们没有工作。

我只是想从头开始学习Symfony2的。所有互联网资源,假设你已经有一些其他的框架类似于Symfony的工作,这是不是你的第一所以他们包括在术语和不解释什么。我只知道HTML,CSS,JavaScript和PHP,所以我想学习如何使用Symfony的,这是我用过的第一个框架。

我只有一个可能取消在 symblog.co.uk/

所以我遵循教程中的步骤,尽管拼尽全力写有我得到不同的结果。起初,他们对新安装的网页看起来像

http://postimg.org/image/4mgq50imn/

而我看起来像(左屏幕)

http://postimg.org/image/4p6ft0h8r/

我也把它与应用程序异常/例如任何其他页面是空白的。

要继续教程中,我需要使用的应用程序接口无法正常工作的主页。我不能访问它。我可以明显地编辑与数据库连接文件,但我想按照教程做的东西,因为我是新来的框架。

能否请您帮助我这个问题?我猜这是路由的问题,但在教程中他们首先他们的网页的工作,然后他们建议,开始创建/改写路由。

我可能不会听起来像我是一个非常有智慧的人。但是,这是最后的地方,我可以要求在互联网上的帮助。在其他地方,他们只是回答我的长消息是这样 - 路由或主机,并送我到Symfony的网站(尽管我说,这是地方,我是看不惯/找到答案)。所以,如果你觉得有什么不对的,因为我从上周开始学习Symfony和不理解太多,即使我花了很多时间寻找问题的答案,请忽略这个问题,或回答我喜欢,从来没有使用框架的人。

下面是我的Apache httpd.conf:

 别名/ bitnami //选择/ LAMPP / Apache2的/ htdocs中/
别名/ bitnami的/ opt / LAMPP /的Apache2 / htdocs目录<目录的/ opt / LAMPP /的Apache2 / htdocs目录>
    选择了FollowSymLinks索引
    所有的AllowOverride
    为了允许,拒绝
    所有允许
< /目录>#/etc/httpd/conf/httpd.conf中127.0.0.1了NameVirtualHost<虚拟主机127.0.0.1>
  服务器名symblog.dev
  DocumentRoot的/opt/lampp/htdocs/symblog.dev/web
  DirectoryIndex的app.php
  <目录/opt/lampp/htdocs/symblog.dev/web\">
    所有的AllowOverride
    从所有允许
  < /目录>
< /虚拟主机>

和我说这etc / hosts中

 #的/ etc / symfony中,从主机教程
127.0.0.1 symblog.dev

我不知道该怎么办。我只是想通过这个教程对一些Symfony的想法......


解决方案

可能是我张贴了错误的答案,但有一个名为阿克米捆绑其中包括了一些演示页面,CONFIGS之前,但它最近被移除。如果你看看网​​站文件夹中的文件,还有 app.php app_dev。 PHP 的config.php 文件,该的config.php 文件应该输出< A HREF =htt​​p://postimg.org/image/4mgq50imn/相对=nofollow>这个页面,而不是 app_dev.php 。试图直接打开它,像 http://symblog.dev/config.php

如果你想尝试,如果你的安装工作或没有,你可以打开应用程序/例子页,这是最新版本出货。它应该输出这个页面。您还可以看看本教程为更好地了解(V2.3为写)系统如何工作的。

I have a problem and I know that you will assume that it was covered in many other similar topics. But please bear with me for a moment. I've read other topics about

No route found for GET/

but my problem is different. It works for other programmers when they used url/app_dev.php and was not working only while using url/app.php. For me none of them works.

I am just trying to learn Symfony2 from scratch. All internet resources assume that you had already worked with some other framework that is similar to Symfony and it is not your first so they are covered in jargon and do not explain anything. I just know HTML, CSS, Javascript and PHP, so I want to learn how to use Symfony and this is the first framework I have ever used.

I have only one possible to decode tutorial on symblog.co.uk/

So I follow the steps from tutorial and despite doing all they write there I get different result. At first their homepage on fresh installation looks like that

http://postimg.org/image/4mgq50imn/

While mine looks like that (Left Screen)

http://postimg.org/image/4p6ft0h8r/

And I also get it on any other page with exception of app/example that is blank.

To continue tutorial I need to use application interface from working homepage. And I can not access it. I can obviously edit file with database connection but I want to do stuff according to tutorial because I am new to frameworks.

Can you please help me with that problem? I am guessing this is the problem with routing, but in tutorial they first had their homepage working and then they advise to start creating/rewriting routing.

I probably do not sound like I am a very wise person. But this is the last place I can ask for help on the internet. Everywhere else they just answer my long message like this - "routing" or "hosts" and send me to the Symfony website (despite me saying that this is place where I was and couldn't understand/find answer). So if you think that there is something wrong with me because I started learning Symfony last week and do not understand much, even if I spent many hours searching for answers please ignore this question or answer me like to person that never used frameworks.

Here is my apache httpd.conf:

Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"

<Directory "/opt/lampp/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

# /etc/httpd/conf/httpd.conf

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
  ServerName symblog.dev
  DocumentRoot "/opt/lampp/htdocs/symblog.dev/web"
  DirectoryIndex app.php
  <Directory "/opt/lampp/htdocs/symblog.dev/web">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

And I added this to etc/hosts

# /etc/hosts from symfony tutorial
127.0.0.1     symblog.dev

I don't know what to do. I just want to go through this tutorial to have some idea about Symfony...

解决方案

May be I'm posting the wrong answer, but there was a bundle called Acme which consisted of some demo pages, configs before, but it was removed recently. If you look at the files of web folder, there are app.php, app_dev.php, and config.php files, and this config.php file should output this page, not app_dev.php. Try to open it directly, like http://symblog.dev/config.php.

If you want to try if your installation is working or not you can open app/example page, which is shipped by the latest version. It should output this page. You can also look at this this tutorial (written for v2.3) for better understanding how the system works.

这篇关于Symfony的2全新安装没有URL作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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