Symfony2的新项目不加载资源 [英] Symfony2 new project does not load resources

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

问题描述

我是新来的的Symfony2 ,我试图按照教程创建一个简单的项目。我下载Symfony和打开网​​络/ config.php文件。我可以看到页面的内容,但没有资源(CSS和图像)的加载。我很新的Symfony和搜索很长一段时间,但无法找到解决方案。谁能帮我呢?

I'm new to Symfony2 and am trying to follow a tutorial to create a simple project. I downloaded Symfony and opened web/config.php. I can see the content of the page but none of the resources (css and images) loaded. I'm very new to symfony and searched for a long time but can't find the solution. Can anyone help me with it?

下面是我的的屏幕截图的config.php 的config.php 从教程:

Here's a screen shot of my config.php and the config.php from the tutorial:

我也注意到,当我点击页面上的三个环节的链接不带我到正确的目标。例如,它带我到 HTTP://localhost/web/config.php/app_dev.php/_configurator/ 时,适当的链接应该是 HTTP://localhost/web/app_dev.php/_configurator/ 。请注意,它的作用是,它没有从URL中删除的config.php 。由于臭名昭著的事实,PHP不直观地处理相关指令我的猜测是,这是问题的根源。不过,我真正的新Symfony和不知道如何解决这个问题。

I also noticed that when I click the three links on the page the link doesn't take me to its proper target. For example, it takes me to http://localhost/web/config.php/app_dev.php/_configurator/ when the proper link should have been http://localhost/web/app_dev.php/_configurator/. Notice that what it does is that it didn't remove the config.php from the url. Given the infamous fact that php doesn't handle relative directive intuitively my guess is that this is the root of the problem. However, I'm really new to symfony and don't know how to fix this.

感谢

编辑:
我使用apache2.4在Windows

I'm using apache2.4 on Windows

推荐答案

这似乎只是你没有正确安装静态资产。

It just seems like you haven't correctly installed the static assets.

这是你的shell试试下面的命令:

Try the following command on your shell:

CD /路径/要/项目
PHP应用程序/控制台资产:安装网络

另外,如果您使用的是支持符号链接文件系统(#nowindows)

Alternatively, if you're using a filesystem that supports symbolic links (#nowindows)

PHP应用程序/控制台资产:安装网络--symlink

然后刷新config页面 - 应该这样做。

then refresh the config page - that should do it.

这篇关于Symfony2的新项目不加载资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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