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:
Tweet This






