-->

Problem Solving: Images Not Showing In Virtuemart

I found many peoples has similar problem with images displaying in Virtuemart. Usualy if you clicking view image you will found like this:
http://yourdomain/components/com_virtuemart/show_image_in_imgtag.php?filename=resized%2Fnameofyourimagejpg&newxsize=90&newysize=90&fileout=
or even some internal error occur:
Internal Server Error 500
Some of them found these problem after upgrade, and the others found these problem suddenly without changing anythings. So in this articles i want to share several problem solving for your virtuemart images.

JUST CHMOD IT

When you found your Virtuemart images didnt show, you should check your file and folder permissions. Here are the folder and images you should check:
/components
/components/com_virtuemart/show_image_in_imgtag.php
/components/com_virtuemart/shop_image/product/resized
administrator/components/com_virtuemart/virtuemart.cfg.php

Case 1
See if the files and directories above is set to 777, so you must change it into 755 (usually the internal server error 500 will occur if you not change)
visa versa
Case 2
See if the directory is set to 755, so you must change it into 777 (usually http://yourdomain/components/com_virtuemart/show_image_in_imgtag.php?filename=resized%2F will shown when you didnt change the permission)

Remember, tested one by one all files and directories above.

CHECK YOUR PATH

This is often happen when we moving Virtuemart from local computer into our host. But this is may occur in fresh installation in your host.

Open: administrator/components/com_virtuemart/virtuemart.cfg.php
and find this on line 34:



// these path and url definitions here are based on the Joomla! Configuration
define( 'URL', $mosConfig_live_site.$app );
define( 'SECUREURL', 'http://localhost/' );

Just check if your url path there is correct, if not, change with your joomla url.

CHANGE READFILE FUNCTION

In some host, the readfile[] function will disabled for security reasons (usually happen in free host) you can check your error log, and find error like this to ensure that you have readfile[] function problem:

PHP Warning: readfile() has been disabled for security reasons in /home/user/public_html/components/com_virtuemart/show_image_in_imgtag.php on line 125

if you found that problem, thats mean your host was disabled readfile[] function. Readfile is needed for showing your images in Virtuemart, if disabled, so we can changing with other function, like file_get_contents
Lets change..
Open file: /components/com_virtuemart/show_image_in_imgtag.php
and find this on line 149:

case ".gif":
header ("Content-type: image/gif");
readfile($fileout);
break;
case ".jpg":
header ("Content-type: image/jpeg");
readfile($fileout);
break;
case ".png":
header ("Content-type: image/png");
readfile($fileout);
break;

Change into file_get_contents function so it will be:

case ".gif":
header ("Content-type: image/gif");
echo file_get_contents($fileout);
break;
case ".jpg":
header ("Content-type: image/jpeg");
echo file_get_contents($fileout);
break;
case ".png":
header ("Content-type: image/png");
echo file_get_contents($fileout);
break;

Close and save the file, and then your images will showing again.

ads:



Related posts:

  1. How To Remove Virtuemart Logo In Empty Cart Module
  2. How To Manage Virtuemart Admin From Joomla Frontend
  3. PHP Include Function Error, How To Fixed That?
  4. How To Showing All Content Items On Joomla 1.0.xx RSS / Syndication
  5. Joomla


Share To Facebook | Tweet This


 
  • Chimezie

    I have followed all these steps, and my images would not show. It would not even show also on the virtuemart scroller. Please help

  • http://ninoholic.com El Nino

    Dont do it all together, choose one of them (or check it one by one):

    • Just CHMOD This
    • Check Your Path
    • Change Readfile Function
  • http://www.limousineofchicago.com/ chicago limousine service

    This was also my problem before with my past client. The tips you have stated are the thing I’ve also do. These are really effective.

  • http://skinmagic.me Osman

    tried all the steps above but the images are still not showing.

  • duane

    I have spent hours nearly days trying to solve this and your instructions really Helped, they allowed me to show images and resize.

    It installed Virtuemart from a fresh install and the images did not display.

    Thank you again

    Duane

  • http://www.tuseqit.com Dan

    Brilliant ! Move the site from a local server to a web host and the url was still refencing the local server . edited the url path as stated above. works great. Thank you

  • http://www.airjordanmaxfusion.com/rss_feed.html?feed=new_products New Ken Griffey Shoes

    Wicked Cool Post, Thanks for the help

-->