Showing posts from June, 2011

Script for to remove the cache - Magento

Here i paste code to remove the cache from the magento.. magento can provide a options to us to remove cache form the admin configuration, but sometimes it not more helpful to us... so expert suggest to remove cache folder..

make one cache-clear.php file into your root folder and paste following code:

<?php require_once ("app/Mage.php"); umask(0); Mage::run(); Mage::app()->getCache()->clean(); exit("done"); ?> can call that file with :http://yourdomainname/cache-clear.phphope this helps :)Cheers,Gaurav

Could not determine temp directory, please specify a cache_die manually..after magento installed

Hi guys,

After magento is installed, you may have the error "Could not determine temp directory, please specify a cache_dir manually" when clicking on some pages.

Usually it happened in shared web hosting, and on individual server it happened when the permission of tmp folder set wrong.

Firstly, copy "/lib/Zend/Cache/Backend/File.php" to "/app/code/local/Zend/Cache/Backend/File.php", then in line 91:
'cache_dir' =>  null,
change to
'cache_dir' => "var/tmp/",
You can also change the cache folder wherever you want, and that directory you should create yourself and change the permission to 755.

and you done :)

Magento Admin login problem

I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page.
Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.

luckily i found solutions:

The solution is to modify the core Magento code.
Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the lines 80 to 83.
The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line:
$this->getCookie()->getPath()//, // set session cookie params session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath()//, //$this->getCookie()->getDomain(), //$this->getCookie()->isSecure(), //$this-…

Magento Reindexing problem - take too long time

There are problem in reindexing in magento many times due to number of factors:

The number of productsThe number of store viewsThe apache/lighttpd timeout settingThe php.ini maximum execution time & script input timeThe lock file is still place from the previous time can preventing it running again one more thing VPS or dedicated server is must have for Magento.

here i paste the trick/tips for the same.

First of all increase your execution time value from the .htaccess
# php_value memory_limit 64M php_value memory_limit 128M php_value max_execution_time 18000 Now open your shell/terminal:
go on upto "public_html/app/shell"

use "ls -l" command, to list out the files.
there is one indexer.php file in the list.

php indexer.php --info (Will shows list of allowed indexers) php indexer.php --reindex all (Reindex data by all indexers) If you wish to reindex one by one then use following commands:
php indexer.php --reindex catalog_…