Exception printing is disabled by default for security reasons Error in Magento – Magento code snippets

Here i shared some useful magento code, 
i think this code is useful sometime. This details learned it from 
some otherwebsite and some points i had been worked out. 
what i learned/worked, i would like to share to all. In case any issue or 
wrong code if you find it from below, please excuse.

1. How top get Session details ?

<?php
$sessionId  = Mage::getModel('core/session')->getSessionId();
$customerId = Mage::getModel('customer/session')->getCustomerId();
$vistitorId = Mage::getModel('core/session')->getVisitorId();
?>

2.How to get Store details?

<?php
$storeId     = Mage::app()->getStore()->getId();
$storeName   = Mage::app()->getStore()->getName();
$storeCode   = Mage::app()->getStore()->getCode();
$groupId     = Mage::app()->getStore()->getGroupID();
$groupName   = Mage::app()->getStore()->getGroup()->getName();
$websiteName = Mage::app()->getWebsite()->getName();
?>

3. How to remove index.php from Magento URLs?

if you are using Magento and your store urls are looking this way,
http://www.example.com/index.php/toys/toy.html (This is example URL)
So, you must be looking, how to remove that index.php from the middle, 
as that’s not good for Search Engine Indexing at all. 
So, here is the trick.

Step: 1 Open your site root folder and you can find the .htaccess file. 
Just edit that. Open it on a text editor and find this line, 
#Rewrite Base /magento/.  Just replace it with Rewrite Base /

Step: 2 Then go to your Admin Panel and enable the Web Server Rewrites. 
You can find it at System > Configuration > Web > Search Engine 
Optimization.

Step: 3 Then goto your Cache Management page 
( System > Cache Management) and 
refresh your Cache and also refresh the Web Redirects.
Thats all. Test at Frontend now.

4. Exception printing is disabled by default for security reasons  Error in Magento :

If we face any issue like as follow
Issue:
Exception printing is disabled by default for security reasons
Error log record number: *********
here has been an error processing your request
Solutions
In this case we need to check following steps.
Step 1 : Go to folder /errors/
Step 2 : Change local.xml.sample to local.xml
Step 3 : after this change you can see few more errors.
then Open magento/lib/Zend/Cache/Backend/File.php
and search 
From 
protected $_options = array(
'cache_dir' => 'null', 
To
protected $_options = array(
'cache_dir' => 'tmp/', 
Save the changes.
Step 4 : create tmp folder under root magento folder.
Ref : http://www.eukhost.com/forums/f15/exception-printing-disabled-default-
security-reasons-error-log-record-numb-11362/

5. After Submit Registration form its redirect to where? 
And basic validation also has to check below file.
app/code/core/Mage/customer/controllers/AccountController.php

After submit Registration form it will display Success or failure
message from above file.

Leave a Reply