diff --git a/tasks/main.yml b/tasks/main.yml index 0e3ddf2..6768fdb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -33,10 +33,9 @@ - php_ini - php_ini_cli -# Note: Xdebug is not packaged on PHP7.0 - name: INCLUDE | Xdebug include: xdebug.yml - when: php_install_xdebug and php_version == 5 + when: php_install_xdebug - name: APT | Install and configure opcache include: opcache.yml diff --git a/tasks/xdebug.yml b/tasks/xdebug.yml index c53d795..1e54b88 100644 --- a/tasks/xdebug.yml +++ b/tasks/xdebug.yml @@ -1,13 +1,21 @@ --- - name: APT | Install php-xdebug - apt: pkg=php5-xdebug state=latest update_cache=yes cache_valid_time=3600 + apt: > + pkg="{{ php_apt_prefix }}xdebug" + state=latest + update_cache=yes + cache_valid_time=3600 - name: SHELL | Get Xdebug version - shell: dpkg -l | awk '$2 ~ /^php5-xdebug$/ { print $3 }' + shell: dpkg -l | awk '$2 ~ /xdebug$/ { print $3 }' changed_when: false register: xdebug_version - name: TEMPLATE | Deploy module configurations - template: src=etc/php5/mods-available/xdebug.ini.j2 dest=/etc/php5/mods-available/xdebug.ini owner=root mode=0644 + template: > + src=etc/__php__/mods-available/xdebug.ini.j2 + dest={{ php_mods_dir }}/xdebug.ini + owner=root + mode=0644 notify: restart php-fpm diff --git a/templates/etc/__php__/mods-available/xdebug.ini.j2 b/templates/etc/__php__/mods-available/xdebug.ini.j2 index 72f716a..59a1a3b 100644 --- a/templates/etc/__php__/mods-available/xdebug.ini.j2 +++ b/templates/etc/__php__/mods-available/xdebug.ini.j2 @@ -4,7 +4,11 @@ ; configuration for php xdebug module ; priority=20 +{% if php_version | version_compare('7.0', 'ge') %} +zend_extension=xdebug.so +{% else %} zend_extension={{ php_extension_dir.stdout }}/xdebug.so +{% endif %} {% if xdebug_version.stdout|version_compare('2.3', 'gt') %} {% endif %}