Can Not Show Jpg Image

Dear all,

I want to display an image but the problem that Yii can not show jpg image, what is the reason ?

here is my code :

<img src="<?php echo Yii::app()->baseUrl.'../images/icon_add.jpeg'; ?>" />

<img src="<?php echo Yii::app()->baseUrl.'../images/head.jpg'; ?>" />

on 2 lines above, it just display jpeg image.

hi, check ur reqirement…like


what do you mean? I have 2 images in one folder,I display 2 images in one php page,but it just display the jpeg image, I do not know why it do not display jpg image?

Ok try this …

         	Instead of Yii::app()->baseUrl

  Try this: Yii::app()->getBaseUrl(true)

  By default, baseUrl returns relative URL.

  <img src="<?= Yii::app()->getBaseUrl(true) ?>/image/your _image.jpg" />      

  1. check that head.jpg file exists in the /images folder

  2. check that the file is not corrupted

  3. check that webserver has access to this file (file permissions, htaccess etc)