petejkim / autoparts

package manager for nitrous.io
BSD 2-Clause "Simplified" License
81 stars 84 forks source link

Add XDebug Part for PHP Debugging #121

Open taras opened 10 years ago

taras commented 10 years ago

I would like to use Nitrous as a replacement to my local LAMP stack for PHP development. To do this, I need to be able to use XDebug. Is this possible?

amsross commented 10 years ago

I see they added it in codio: https://github.com/codio/boxparts/issues/67

In Nitrous, you can currently install xdebug by running:

# pecl install xdebug

Then, you need to add the extension to your php.ini:

zend_extension=xdebug.so

Then, if you were trying to use it with phpunit for example, you can tell phpunit to use your php.ini file:

# php -c /home/action/.parts/etc/php5/php.ini' `which phpunit` --coverage-html=web/cov -c app

You can ease the use of these by putting them in your .bashrc or .bash_profile:

alias php='php -c /home/action/.parts/etc/php5/php.ini'
alias phpunit='php `which phpunit`'

Then it's just

# phpunit --coverage-html=web/cov -c app

Bam!