Skip to main content

Pixwel API - Xdebug

You can use xdebug on the API. Xdebug can be installed on your local development environments. It can be used for code coverage analysis also. ## Xdebug/PHPStorm integration https://confluence.jetbrains.com/display/PhpStorm/Debugging+PHP+CLI+scripts+with+PhpStorm If you are working with the docker container, you can get Xdebug working and set breakpoints in the PHP code. This means you can be using the UI and set breakpoints in the API. Uncomment the following lines in the API Dockerfile and replace xdebug.remote_hose with the IP address of your machine.
RUN yes | pecl install xdebug \
     && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
     && echo "xdebug.remote_host=10.0.0.107" >> /usr/local/etc/php/conf.d/xdebug.ini \
     && echo "xdebug.remote_port=9009" >> /usr/local/etc/php/conf.d/xdebug.ini \
     && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
     && echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
then:
docker-compose up --build
If you’re using PHPStorm, click the button that’s labelled like “hang up the phone”. Then, when you hit some breakpoints, you should get a mapping screen. Map your local /var/www/pixwel-api to remote /opt/pixwel/pixwel-api . That should be it!
TODO: These instructions haven’t been tested in a while, please test and update.

Back to docs index | API docs index