123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computers >> View Article

How To Debug Magento Step By Step?

Profile Picture
By Author: Sam George
Total Articles: 13
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

The following debugging tips can be applied towards any LAMP/XAMPP application we wanted to give a more brief focused step by step debugging checklist for Magento.

Get XDebug or ZendDebugger Working

When all else fails, putting a break-point in the beginning of your back trace and stepping line by line is the best way to debug and/or learn what Magento is doing.

Articles about setting up XDebug with PDT

Articles about setting up ZendDebugger with PDT

Clear the Cache

If you are using caching at all within Magento, one of the first steps to answering the question – “Why is this not working?” – is to clear the Magento cache. There are two ways to clear the cache:

System > Cache Management > Select All > “Refresh” Massaction > Submit

Delete the “cache” directory under BASE_MAGENTO_DIR/var

Clear the Browser Cache

More than once, I have wasted 10 minutes trying to figure out why something wasn’t rendering to the browser correctly, only to find that my browser was caching old responses. If you don’t know how to clear your browser cache, see the ...
... following links:

Firefox

Internet Explorer

Safari

Google Chrome

Make Sure Your Configurations Are Set For the Proper Scope

Because the System > Configurations can be set for specific scopes (Default / Website / Store View), we have to make sure that we have set the configurations for the proper scope. To check this, use the Magento Admin Panel -

System > Configuration > Upper Left Corner (Change to the scope/store view you are working with)

Turn On Logging

This one is a big one. Almost EVERY time, if there is a problem in Magento, something will appear in either the system.log or the exception.log. Checking these logs should become second nature to you. To turn on logging, use the Magento Admin Panel -

System > Configuration > Advanced > Developer > Log Settings > Enable

Check the magento exception.log under BASE_MAGENTO_DIR/var

Check the magento system.log under BASE_MAGENTO_DIR/var

Use Template Path Hints

Template Hints are pretty amazing. When you want to figure out which Block or phtml file a problem is occurring in, you can turn on template hints and see the information right on the browser. It’s awesome, so if you haven’t tried it, try it right now.

To turn on template path hints, use the Magento Admin Panel -

First, you NEED to select the store view you want to show the hints on. If you don’t, the configuration option won’t appear.

System > Configuration > Advanced > Developer > Debug > Template Path Hints and/or Add Block Names to Hints

By default, there is no way to turn on hints for the Admin Panel, so take a look at this article for help: Enable Template/Block Hints in Admin Panel

Tracing

If you have implemented a home-grown tracing mechanism, turn it on and look at the log. A common tracing mechanism consists of coding tracing statements within the code that log ENTRY into a function, important information within the function, and EXIT from the function. This information can be crucial in debugging problems in a production environment.

XDebug Tracing

XDebug provides some pretty kick-butt tracing ability. If you turn it on, get ready for a lot of data, but it can be very helpful when trying to pinpoint a problem.

Check the Apache error_log

When all else fails, take a look at the apache error_log. It could be a problem with the setup of your webserver.

Google It

It may come as a surprise, but there are still people that don’t turn to Google as a “troubleshooting option”. They should. When you want to ask a developer something, first ask it to Google. For instance, if you want to know how to do a rewrite of a model, just Google: How do I rewrite a model in Magento. If you want to know why you are getting an error like “HEADERS ALREADY SENT”, Google: headers already sent magento. Chances are, another developer will give you a response like THIS if you ask them the question anyway.

Search Or Ask The Magento Forums

One of the big pros to Magento is the active community members. Many are willing to help answer your questions for free, and quickly. Before you ask your question, search the forums. If you don’t find your answer, ask your question.

Use the Varien_Profiler

If you are having performance issues, turn on and use the Varien_Profiler. Do this in the Admin Panel -

System > Configuration > Advanced > Developer > Debug > Profiler

Then, if you still can’t figure it out, start all over again.

Total Views: 316Word Count: 731See All articles From Author

Add Comment

Computers Articles

1. How To Use Travel Web Scraping Service To Scrape Hotel Data And Travel Data?
Author: #ScrapeHotelDataandTravelData

2. 15 Best Tools To Manage Remote Teams And Stay Connected
Author: goodcoders

3. 12 Types Of Software Developers
Author: goodcoders

4. 12 Reasons Why Startup Needs Mobile App
Author: goodcoders

5. Why It Is Necessary To Have Pc Gaming Updates
Author: Jack Williams

6. Navigating Phone Repair Myths In Las Vegas: The Truth Behind Third-party Services
Author: Fones Gone Wild

7. The Truth About Microsoft Support And Visual Foxpro Migration
Author: John Mathew

8. Laptop Repair - Hardware And Software Troubleshooting
Author: Joshua Kirby

9. Salesforce Security Best Practices | Yantra Inc
Author: Yantra Inc

10. Foxpro And End Of Life Migrations
Author: John Mathew

11. Effortless Outreach: Kingasterisk Voice Broadcasting Solution In Action
Author: Kingasterisk Technology

12. The Impact Of Ai On Voip Cost Savings: A Case Study
Author: Sandip Patel

13. 12 Effective Mobile App Testing Types
Author: goodcoders

14. 12 Best Practices To Improve Your Qa Testing Skills
Author: goodcoders

15. 12 Best Apps For Small Businesses
Author: goodcoders

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: