php - 在 ubuntu 12.10 的 htdocs 中看不到图像?

标签 php image ubuntu htdocs

我正在使用 Ubuntu 12.10,最近安装了 xampp 1.8.1。我的问题是:无法显示来自服务器的图像,如下图所示:
image not shown

看这里是在我使用的地址栏中本地主机/madeTemplet/basicTemplet/templet03.html 我想在 之后显示图像无名英雄 文本,但它只显示了一些链接而不是任何图像。

我将以下代码用于图像::

<div class="sideBlock unSung">
   <h4>Unsung heroes...</h4>
<a href="#"> <img src="_images/1_full.jpg" alt="Midnight Run" width="99" height="135" /> </a>

<a href="#"><img src="_images/2d7y3ki.jpg" alt="Wyatt Earp" width="99" height="135" /></a>
</div>

但是当我使用以下内容时:

image is shown

看这里是在我使用的地址栏中 file:///opt/lampp/htdocs/madeTemplet/basicTemplet/templet03.html 和图像显示在 之后无名英雄 文本。

检查访问图像所在目录的权限后,我在终端窗口中获​​得此文本::
  sabbir@sabbir-pc:/opt/lampp/htdocs/madeTemplet/basicTemplet/_images$ ls -l
  total 300
 -rw------- 1 sabbir sabbir 204067 Feb 24  2010 1_full.jpg
 -rw------- 1 sabbir sabbir  75789 Nov 13  2009 2d7y3ki.jpg
 -rw------- 1 sabbir sabbir  23692 Apr 21  2010 6AB32AE44600435B9DE0FB5EBA24A912.gif

最佳答案

您可能正在使用 file:///用于寻址 HTML 页面内的图像的路径。不要那样做;使用与服务页面相同的协议(protocol)和主机名,即。 http://localhost .

出于安全原因,对本地 (file://) 路径的访问通常在浏览器内部受到限制。

关于php - 在 ubuntu 12.10 的 htdocs 中看不到图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16178342/

相关文章:

php - CAKE_CORE_INCLUDE_PATH 麻烦

php - 根据平均值分配行

ios - 使用 renderInContext 的 Obj-C

mysql - 使用 dbf2mysql 将 dbf 文件转换为 csv?

php - 命令不同步;您现在无法使用 mysql 存储过程在 SugarCRM 中运行此命令

php - Laravel 队列/重命名作业表

ios - xamarin ios 像 Android 一样裁剪图像

html - 图像悬停不起作用

linux - 加载共享库 : libncurses. so.5 时出错:

c++ - OpenCV 错误 : Assertion failed (a_size. 宽度 == 长度)