在 Symfony 1.4.8 中显示图像时出错
注意:很难确定这是属于这里还是 ServerFault,但这似乎是一个编程问题,所以如果它不合适,请随意迁移它。
我下载了 Symfony 1.4.8 的沙箱并将文件复制到我的网络服务器。不幸的是,当我尝试访问 /symfony/sf_sandbox/web/
(我安装它的位置)时,我得到以下信息:
图像似乎没有显示。根据正文:
如果您在此页面中没有看到图像,您可能需要配置您的 Web 服务器,以便它能够访问
symfony_data/web/sf/
目录。
但是,当我尝试找到上面引用的文件夹时,它不存在:
sf_sandbox web css/ images/ js/ uploads/ frontend_dev.php index.php robots.txt
如您所见,web/
下没有 sf/
目录。我做错了什么?
注意:我正在使用 Apache 在 Ubuntu 10.04 64 位上安装此程序。
Note: It was tough deciding whether this belonged here or ServerFault, but it seemed like a programming problem, so if it's out of place, feel free to migrate it.
I downloaded the sandbox of Symfony 1.4.8 and copied the files to my webserver. Unfortunately, when I try to access /symfony/sf_sandbox/web/
(where I installed it), I get the following:
It seems like the images aren't showing. According to the text:
If you see no image in this page, you may need to configure your web server so that it gains access to the
symfony_data/web/sf/
directory.
However, when I try to locate the folder referenced above, it does not exist:
sf_sandbox web css/ images/ js/ uploads/ frontend_dev.php index.php robots.txt
As you can see, there is no sf/
directory under web/
. What am I doing wrong?
Note: I am installing this on Ubuntu 10.04 64-bit using Apache.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
所有图像都位于 Symfony 源目录中。
我会尝试在名为 sf 的 Web 文件夹中创建一个指向以下内容的符号链接:
lib\vendor\symfony\data\web\sf
此时它应该可以访问所需的图像。
All the images are located in the Symfony source directory.
I would try creating a symbolic link in the web folder called sf pointed to the following:
lib\vendor\symfony\data\web\sf
It should have access to the needed images at that point.
这是通过在 apache 配置中的 Alias 指令中指示正确的路径来完成的:
只需将“/home/sfprojects/jobeet”替换为项目的路径,它就应该可以工作。
This is done by indicating the right path in the Alias directive in your apache configuration:
Just replace "/home/sfprojects/jobeet" with your project's path and it should work.
此页面显示了正确设置新项目的 apache 配置。
您的网络应用程序还有重要的安全说明。
Symfony 文档
This page shows the apache config to set up a new project correctly.
There are also important security notes for your webapp.
Symfony Documentation
您所需要做的就是将整个 sf 文件夹复制到 web 文件夹。就我而言,我将 c:\wamp\www\jobeet\lib\vendor\symfony\data\web\sf\ 复制到 c:\wamp\www\jobeet\web。希望这是有道理的
All you need to do is copy the whole sf folder to the web folder. In my case i copied c:\wamp\www\jobeet\lib\vendor\symfony\data\web\sf\ to c:\wamp\www\jobeet\web. Hope that makes sense