Debugging PHP over xdebug with Eclipse and Vagrant
This documents the configuration needed to debug FusionForge PHP code under the Eclipse IDE (equipped with the PDT PHP development environment), while executing the code inside the Vagrant-based virtual machine development environment.
This requires :
- sharing the source code between the host and guest
- the activation of the XDebug PHP extension in the VM
Sharing the source code between the host and guest
This is needed so that modifications of the PHP code are instantaneously taken into account in the execution environment.
For this you may for instance add a shared directory in the Vagrantfile, by uncommenting the line :
#config.vm.synced_folder "../src", "/usr/share/gforge"
if you wish to execute the code present in the Git repo from where the vagrant up command is performed
Another option is to perform the following steps before installing the packages built inside the VM (refering to Building and installing FusionForge instructions) :
[... ./build.sh] mkdir /vagrant/usr_share_gforge ln -s /vagrant/usr_share_gforge /usr/share/gforge [... ./install.sh]
This ensures that the PHP code will be extracted in a directory that gets created in the directory where vagrant up was performed on the host