PHP & XDEBUG

Posted by:

  • Environment: Ubuntu with LAMP (Apache, PHP, MySql)
  • Install xdebug:
[code language=”bash”] sudo apt-get install php5-dev php-pear
sudo apt-get install php5-xdebug
sudo php5enmod xdebug
sudo /etc/init.d/apache2 restart
[/code]

 

  • Find path xdebug.so
[code language=”bash”] find /usr/lib -name ‘xdebug.so’
[/code]

/usr/lib/php5/20121212/xdebug.so

  • Find path php.ini
[code language=”bash”] find / -name ‘php.ini’
[/code]

/etc/php5/apache2/php.ini

  • Add these lines into php.ini
    zend_extension="/usr/lib/php5/20121212/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
  • Restart apache
[code language=”bash”] sudo /etc/init.d/apache2 restart
[/code]
  • Check xdebug

Create phpinfo.php with content:

<?php

phpinfo();

?>

Install in local, a recommended configuration of php.ini

  • max_execution_time = 1000 ( timeout php execute)
  • memory_limit = 512M
  • post_max_size = 100M
  • upload_max_filesize = 100M

 

 

 

0