undefined symbol: zend_sort
Issue Type
- Bug Report / Support Request
Your Environment
Vagrant 1.9.1
bash: vboxmanage: command not found
VirtualBox
bash: ansible: command not found
VirtualBox: Version 5.0.30 r112061
Your OS
- Windows 10
Full console output
N/A
Summary
After switching from php7.0 to 5.6 and running vagrant provision the following error would pop up in the console randomly while running drush commands:
Failed loading /usr/lib/php5/modules/xdebug.so: /usr/lib/php5/modules/xdebug.so: undefined symbol: zend_sort
vagrant destroy and vagrant up seemed to fix it -- but oxyc requested I open a new issue.
Found the bug. It's because https://github.com/geerlingguy/ansible-role-php-xdebug/blob/master/tasks/main.yml#L33:L42 (and xhprof, uploadprogress) do not re-compile as there's no name change. It simply copies the old version in place.
TASK [geerlingguy.php-xdebug : Build Xdebug.] ********************************** ok: [drupalvm_project] => (item=phpize) ok: [drupalvm_project] => (item=./configure) ok: [drupalvm_project] => (item=make)
For reference: https://github.com/geerlingguy/drupal-vm/pull/1043#issuecomment-268879545
ping @thom8 @geerlingguy maybe fix this in the upstream roles by changing it to something like:
- name: Build Xdebug.
shell: >
{{ item }}
chdir={{ workspace }}/xdebug-{{ php_xdebug_version }}-php{{ php_version }}
creates={{ workspace }}/xdebug-{{ php_xdebug_version }}-php{{ php_version }}/modules/xdebug.so
with_items:
- phpize
- ./configure
- make
notify: restart webserver
That introduces a dependency on the php_version variable though (php_extension_conf_paths is already a dependency).
@oxyc as a workaround we make workspace PHP version specific -- https://github.com/beetboxvm/beetbox/blob/master/provisioning/ansible/config/default.config.yml#L282
Hehe I just realized my suggestion didn't work as it was supposed to be the name of the downloaded file.
Hmm sucks to recompile stuff such as solr etc because of a php version change though.
agreed it's not ideal but it's only an issue when switching php versions on an existing VM.
True, it doesn't happen that often.
@oxyc IIRC the xdebug role always downloads and compiles but won't copy new changes in place due to "creates={{ php_xdebug_module_path }}/xdebug.so"
I tried to address that in PR https://github.com/geerlingguy/ansible-role-php-xdebug/pull/30 but it needs refreshing ( and now would need php version change like above).
@joestewart / @oxyc - If you can get that PR updated for Xdebug, I'll get it incorporated ASAP.
@thom8 's PR 42 looks like a better solution that 30 https://github.com/geerlingguy/ansible-role-php-xdebug/pull/42
@joestewart - Thanks, yes that looks best, so I've merged it upstream.