I am trying to configure Xdebug on a local LAMP server with PHP 5.6 and Ubuntu 16.04 installed and am running into some difficulties. After first following the common installation directions: running "sudo apt install php-xdebug", modifying my php.ini to have the correct config, then restarting my apache server, I was not seeing Xdebug in my info.php (only the xdebug.ini that was being parsed in). When I run "sudo apt install php-xdebug" again however it would say that it was installed / up to date.
After trying a couple different things I was looking and saw that the new version of Xdebug no longer supports version lower than PHP 7, as such I saw what other versions were available by apt and purged the current Xdebug install I had in favor of running "sudo apt install php-xdebug=2.4.0-1" as I saw that version still supported older PHP versions. After this I still had the same issue however so I searched for similar issues.
I tried running "php -m" and "php5.6 -m" and both had different outputs but neither had Xdebug listed under Zend modules. Also ran "php --ini" and the output was
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
"php5.6 --ini" on the other hand outputs:
Failed loading /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: cannot open shared object file: No such file or directory
Configuration File (php.ini) Path: /etc/php/5.6/cli
Loaded Configuration File: /etc/php/5.6/cli/php.ini
Scan for additional .ini files in: /etc/php/5.6/cli/conf.d
Additional .ini files parsed: /etc/php/5.6/cli/conf.d/10-mysqlnd.ini,
/etc/php/5.6/cli/conf.d/10-opcache.ini....
In case it helps here is the output for "php -v"
PHP 5.4.45 (cli) (built: Nov 15 2017 10:53:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
And "php5.6 -v"
PHP 5.6.34-1+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
Not sure why "php -v" shows a different version of PHP and Zend Engine than "php5.6 -v" but figured it may be relevant to my issue. Anyways, I checked to make sure "xdebug.so" existed in that directory so I ran "locate xdebug.so"
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
In the "php5.6 --ini" output it was clear that some path was getting appended to the one I was adding in my /etc/php/5.6/cli/php.ini file, so I commented out
;zend_extension="usr/lib/php/20131226/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_enable = On
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
After doing that when I run "php5.6 --ini" I no longer get the failed loading error but still Xdebug is no where to be found / used. I used step 4 in Check if xdebug is working to check if it is installed properly and I always get call to undefined function so it's clear the installation is wrong. My end goal here is to get Xdebug set up so I can link it with Sublime but the first step is obviously just getting Xdebug installed on my server.
My hunch is it's something to do with my differences between php and php5.6? I've usually been able to get to the bottom of issues through hunting online but at this point I feel like I've tried most suggestions and genuinely don't know what I should do; my experience with these sort of issues is limited as well. Also https://xdebug.org/wizard.php doesn't help as it just says under PHP 7 isn't supported. Hopefully I've detailed everything I've tried so far, any help or things I could try would be greatly appreciated, also if I can provide any more details to figure this out just let me know.