aegir-project / development

A couple of scripts for easier Aegir development using Docker.
11 stars 3 forks source link

How should we debug a drupal site/hostmaster? #6

Open clemens-tolboom opened 8 years ago

clemens-tolboom commented 8 years ago

The image misses ie xdebug which should be added I guess.

clemens-tolboom commented 8 years ago

First we need adjust https://github.com/aegir-project/dockerfiles project with

sudo apt-get install php5-xdebug

Next we need to inject xdebug in file /etc/php5/apache2/conf.d/30-xdebug-aegir.ini containing something like

zend_extension="/usr/lib/php5/20121212/xdebug.so" xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.max_nesting_level=300

(taken from http://wylbur.us/2014-06-17-add-xdebug-to-ubuntu-1404)

Discussed with @helmo it does not seemed wise to always have xdebug enabled as this is used by the tests too and xdebug drains performance right?

clemens-tolboom commented 8 years ago

According to https://github.com/docker-library/wordpress/blob/master/apache/Dockerfile we should use echo

RUN { \
        echo 'opcache.memory_consumption=128'; \
        echo 'opcache.interned_strings_buffer=8'; \
        echo 'opcache.max_accelerated_files=4000'; \
        echo 'opcache.revalidate_freq=60'; \
        echo 'opcache.fast_shutdown=1'; \
        echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
helmo commented 7 years ago

Please checkout https://github.com/aegir-project/dockerfiles/pull/22

jonpugh commented 7 years ago

Thanks, @clemens-tolboom and @helmo. I added a xdebug "tag" Dockerfile, so if you want that instead, you can change image: aegir/hostmaster:xdebug

I agree we shouldn't use it in tests, but we could make it the default in this repo's docker-compose.yml, since it's explicitly for development?