Xdebug (v2.6.1) for Atom (v1.34.0) is not working anymore (breakpoints are not fired at all) after the upgrade to mac-os Mojave. I was able to configure it successfully with High Sierra but after the upgrade I had problems with the httpd.conf of apache2 (I fixed it) and Xdebug does not work any longer.
Even though I found lots of answers related to this topic it didn't work for me any of them.
As you can see Xdebug is installed properly
MacBook-Pro-6:~ francesco$ php -v
PHP 7.1.13 (cli) (built: Feb 1 2018 13:38:42) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.13, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
this is the complete list of configuration settings
MacBook-Pro-6:~ francesco$ php -i | grep xdebug
/usr/local/php5/php.d/50-extension-xdebug.ini,
xdebug
xdebug support => enabled
IDE Key => xdebug.atom
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.gc_stats_enable => Off => Off
xdebug.gc_stats_output_dir => /var/tmp/ => /var/tmp/
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.halt_level => 0 => 0
xdebug.idekey => xdebug.atom => xdebug.atom
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => 2 => 2
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => On => On
xdebug.profiler_enable_trigger_value => no value => no value
xdebug.profiler_output_dir => /var/tmp/ => /var/tmp/
xdebug.profiler_output_name => xdebug-profile-cachegrind.out-%H-%R => xdebug-profile-cachegrind.out-%H-%R
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => On => On
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => 127.0.0.1 => 127.0.0.1
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.remote_timeout => 200 => 200
xdebug.scream => Off => Off
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_enable_trigger_value => no value => no value
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /var/tmp/ => /var/tmp/
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
as you can see xdebug is enabled
xdebug support => enabled
the ide key is xdebug.atom
IDE Key => xdebug.atom
the specific path of the xdebug.ini is at
/usr/local/php5/php.d/50-extension-xdebug.ini
and this is the content of it
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
[xdebug]
xdebug.idekey = xdebug.atom
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1 # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=false
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3
by the way I tried configuring also the xdebug extension pre-installed at /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so with no luck.
xdebug.remote_autostart = false because I have Xdebug Helper for Chrome and ide.key is set to xdebug.atom
I installed php-debug package for Atom and this is my config.json
"php-debug":
ServerPort: 9000
PathMaps: [
"/remote/path;/local/path"
"/Library/WebServer/repositories;/Library/WebServer/repositories"
]
showWelcome: false
my remote and local path are the same because I need to debug my localhost. I am not sure if configuring the local path as remote path is an error but I remember in High Sierra Atom gave me suggestions on how to configure the paths and breakpoints were fired anyway so I am confident that's not the issue.
I tried to remove the paths, add the field ServerAddress, remove the field ServerPort with no luck.
of course I restarted apache every time I was doing some modification.
breack-points are not fired at all and I don't know what to do.
Do you have some idea about that? thank you very much.
As LazyOne pointed out the php7 loaded by Apache in the httpd.conf is the version pre-installed with Mojave
LoadModule php7_module libexec/apache2/libphp7.so
not the PHP 7.1.13 (cli)
I installed.
if I try to set again
LoadModule php7_module /usr/local/php5-7.1.13-20180201-134129/libphp7.so
then the server fail to start and with sudo apachectl configtest
I can see:
httpd: Syntax error on line 176 of /private/etc/apache2/httpd.conf:
Cannot load /usr/local/php5-7.1.13-20180201-134129/libphp7.so into
server: dlopen(/usr/local/php5-7.1.13-20180201-134129/libphp7.so, 10):
no suitable image found. Did find:\n\t/usr/local/php5-7.1.13-
20180201-134129/libphp7.so: code signature in (/usr/local/php5-7.1.13-
20180201-134129/libphp7.so) not valid for use in process using Library
Validation: mapped file has no cdhash, completely unsigned? Code has
to be at least ad-hoc signed.\n\t/usr/local/php5-7.1.13-20180201-
134129/libphp7.so: stat() failed with errno=22
following this answer Apache not working after macOS Mojave update
I tried to replace the file to /usr/libexec/apache2/
like this
sudo cp /usr/local/php5-7.1.13-20180201-134129/libphp7.so /usr/libexec/apache2/
but on the terminal I get always
cp: /usr/libexec/apache2/libphp7.so: Operation not permitted
I followed all the steps mentioned here http://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/
but still Operation not permitted
do you have any idea how to configure the php7 is showed in the php -v
?