Skip to main content

Debugging VTiger CRM

  default Debugging error in the Vtiger.

Database Debugging

50% of all problems are a result of corrupt or wrong database queries. There is a fast an easy way to recognize this and get a detailed output, where you need to search for the issue. Also this information helps support persons of module providers to get a more detailed error description.

Open the file include/database/PearDatabase.php
Search the line $adb->connect(); (At the end of the file)

You have 2 options in this situation:

  1. Add the line:
    $adb->setDebug(true);

    This line will output EVERY Query sent to the database. The last one will be the corrupt one and you get an error description, when an error happens.
    Sometimes it will be helpful to get all queries and also see queries, before the exception

  2. Add the line:
    $adb->setDieOnError(true);

    This line will output only a detailed error report if a query generates an database error. This works better for module support, because you don’t need to read every query, if you don’t want to.

If you find (and maybe solved) the problem, do not forget to disable this lines, because it could lead to unexpected behavior.

PHP Debugging

VtigerCRM disables the display of errors in the browser, per default. This is good and prevents confusion of your employee!

If more users work in one system, you should only use the method of Log-File Debugging, because vtiger will output a lot of unnecessary errors.

Log Files

The easiest way is to take a look in your Webserver error.log. If your server is configured in a default way, or configured by Plesk, ISPConfig, cpanel, … you will found a directory “logs”, which contains a file “error.log”. This error log contains every error, and warning the Vtiger generates. (And this could a lot.)
The most important lines are at the bottom of this file.

If you see something like

... PHP message: PHP Fatal error: ...

You found your problem and you only need to send the line to your administrator or module support.
If you use PHP >= 5.5 you probably need to do 1 modification in the config.inc.php, before you get this error.

To do this open config.inc.php and search for

error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED)

You should find two lines ~17,18, which contain this part. Replace it with

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED)

Otherwise, you don’t get Fatal errors and only see unimportant Warnings.

Display Errors

If you are alone in your or know, nobody else is working, you also could do this. It maybe is a faster to see the error, because it is output to the browser.

Open the file config.inc.php

Search the line, which starts with

//ini_set('display_errors','on'); version....

Remove the // in front of the line, which activates this line. Here is the same notice, as one paragraph before: If you use PHP >= 5.5, you also needs to adjust this line.

Now you could open the blank page again and should see something like

Fatal error:….

This is the problem and if you solve it, the page should work again. If nothing is written to the page, maybe the reason is not PHP.

Email SMTP Debugging

If you would set your SMTP Server and get an error, which means the mail cannot be sent, the vTigerCRM don’t inform in detail about the real problem.
To get the exact error, you must go into the code.

Open the file modules/Emails/mail.php and search for

$mail_status = MailSend($mail);

If you insert the following line, before this MailSend function, you are able to get the complete SMTP Log within the response of Ajax request during the save of Mailserver configuration. (Check your Developer Tools for this)

$mail->SMTPDebug = 2;

Comments

Popular posts from this blog

October CMS E-Commerce Tutorial: GoT White Walkers Protection Store

As many of you probably know, Game of Thrones Season 6 is starting next April 24th. Now I recently introduced myself on this blog , but forgot to mention that I'm, like millions of others, a shameless GoT fan . When our content guy asked me to craft a post showing how the easy e-commerce integration we brag about would work with October CMS, I immediately picked GoT as a theme for the demo. ​ So in this post, I'm going to show you how to set up a store selling defense against the imminent White Walkers invasion. Because WINTER IS COMING big time, you know. ​ ​ More specifically, I'll provide a step-by-step e-commerce tutorial explaining how to integrate our shopping cart platform to an October CMS site. Let's get into it. ​ What is October CMS ​ We've been hearing about October CMS from developers here and there for a while now. This free, open-source CMS platform is the brainchild of fellow Canadian Alexey Bobkov and Australian Samuel Georges. It...

Sublime vs Dreamweaver

13 REASONS TO USE OF SUBLIME TEXT OVER DREAMWEAVER 17 MARCH, 2014 BY TOM ELLIOTT I started writing this post over a year ago but back then it was entitled something along the lines of ‘Reasons why I use Dreamweaver over code editors’. This was biased, as I hadn’t properly explored other code editors like Coda, Sublime Text or Notepad++. So, wanting to write an objective post from a web developers point of view, and because I had heard many good things about it, I setup Sublime Text 2 and dove straight in. I’m glad I did because it quickly became obvious that my presumed reasons for Dreamweaver’s superiority were just wrong. We are all creatures of habit to a greater or lesser degree and when we develop workflows to help make our lives easier, we can get entrenched in the view that these honed practices are superior. It’s not our fault, confirmation bias is supposedly  programmed in our DNA . Even so, it’s healthy to try and keep questioning and challenging ourselves, espe...

JazzCash Mobile Account

  JazzCash Mobile Account Help Center  > JazzCash Mobile Account What is JazzCash mobile account? JazzCash Mobile Account is an actual bank account that is tagged with your mobile number and can be operated through your phone. Through this Mobile Account you can enjoy complete freedom of accessing financial services anywhere, anytime! More importantly, you don’t have to rely on traveling to a Bank branch, wait at queues or complete any documentation. Mobile Account menu works on all types of mobile phones – smart phone is not required. Customers can make deposits or withdrawals through any Mobilink Microfinance Bank Branch, Mobilink Franchise, Mobilink Business Center and Jazzcash Agents spread across Pakistan. JazzCash Mobile App In line with the continuous digitization of its services to meet demands of growing number of smartphone users, JazzCash is proud to announce Android based App for its Mobile Account users. The App offers a user friendly inte...