7/10/2013

yum install xdebug + xdebug test example for php 5.4

Xdebug  is a nice tool for PHP development. The following is taken from official site:

Xdebug's basic functions include the display of stack traces on error conditions, maximum nesting level protection and time tracking.

There are many ways to install xdebug. Now I give one way to use yum for xdebug installment.

 sudo yum  install php-xdebug

or with enable remi repo

sudo yum --enablerepo=remi install php-xdebug

------------------------------------------------------example---------------------------------------------------------------
now let us test one example for xdebug

vi test.php


<?php 

echo $a;

$a++;

echo $a;
?>


>> php test.php

PHP Notice:  Undefined variable: a in /var/www/a.php on line 3
PHP Stack trace:
PHP   1. {main}() /var/www/a.php:0
PHP Notice:  Undefined variable: a in /var/www/a.php on line 5
PHP Stack trace:
PHP   1. {main}() /var/www/a.php:0

No comments:

Post a Comment