在 Symfony 1.4.8 中显示图像时出错

发布于 2024-09-25 02:44:14 字数 692 浏览 0 评论 0原文

注意:很难确定这是属于这里还是 ServerFault,但这似乎是一个编程问题,所以如果它不合适,请随意迁移它。

我下载了 Symfony 1.4.8 的沙箱并将文件复制到我的网络服务器。不幸的是,当我尝试访问 /symfony/sf_sandbox/web/ (我安装它的位置)时,我得到以下信息:

alt text

图像似乎没有显示。根据正文:

如果您在此页面中没有看到图像,您可能需要配置您的 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:

alt text

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

霊感 2024-10-02 02:44:14

所有图像都位于 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.

南城追梦 2024-10-02 02:44:14

这是通过在 apache 配置中的 Alias 指令中指示正确的路径来完成的:

# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080

# This is the configuration for your project
Listen 127.0.0.1:8080

<VirtualHost 127.0.0.1:8080>
  DocumentRoot "/home/sfprojects/jobeet/web"
  DirectoryIndex index.php
  <Directory "/home/sfprojects/jobeet/web">
    AllowOverride All
    Allow from All
  </Directory>

  Alias /sf /home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
  <Directory "/home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

只需将“/home/sfprojects/jobeet”替换为项目的路径,它就应该可以工作。

This is done by indicating the right path in the Alias directive in your apache configuration:

# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080

# This is the configuration for your project
Listen 127.0.0.1:8080

<VirtualHost 127.0.0.1:8080>
  DocumentRoot "/home/sfprojects/jobeet/web"
  DirectoryIndex index.php
  <Directory "/home/sfprojects/jobeet/web">
    AllowOverride All
    Allow from All
  </Directory>

  Alias /sf /home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
  <Directory "/home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

Just replace "/home/sfprojects/jobeet" with your project's path and it should work.

极度宠爱 2024-10-02 02:44:14

此页面显示了正确设置新项目的 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

国粹 2024-10-02 02:44:14

您所需要做的就是将整个 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文