Also I found the next, I guess that the configuration version to compile is another than the one in the CLI and FPM. I found this:
php-config
--extension-dir [/usr/lib/php/extensions/no-debug-zts-20131226]
--include-dir [/usr/include/php]
--man-dir [/usr/php/man]
--php-binary [/usr/bin/php]
--php-sapis [ cli cgi]
--configure-options [--prefix=/usr --with-config-file-path=/etc --enable-maintainer-zts]
--version [5.6.23-dev]
--vernum [50623]

And the one I'm using is different. CLI: PHP 5.6.21-9+donate.sury.org~trusty+1 (cli), and the extension_dir /usr/lib/php5/20131226