PHP & XDEBUG

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

 

  • Find path xdebug.so
find /usr/lib -name 'xdebug.so'

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

  • Find path php.ini
find / -name 'php.ini'

/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
sudo /etc/init.d/apache2 restart
  • 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

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s