-1

I have a trouble installing Xdebug on my PHP project. I am on macOS Monterey M1 and I am using XAMPP for launching project on PHP version 7.4.28.

I followed the instructions given on their official webpage:

Download xdebug-3.1.4.tgz
Run: cd xdebug-3.1.4
Run: phpize (See the FAQ if you don't have phpize).
Run: ./configure
Run: make
Run: cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902
Update /Applications/XAMPP/xamppfiles/etc/php.ini and add the line:
zend_extension = xdebug

When typing php -v in my terminal I first get few errors like:

HP Startup: Unable to load dynamic library 'php_soap.dll' (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/php_soap.dll

I tried following the path and I saw that in the specific folder there is Unix Executable File and not the folder with added files..

enter image description here

How can I bypass this? I know XAMPP is not the best solution for Mac, but I see that it has been used by others.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
keymon
  • 11
  • 2
  • It seems like you have `php_soap.dll` extension enabled in your init file. `.dll` is for Windows only – Justinas May 13 '22 at 12:25
  • 1
    I would suggest installing PHP and xDebug via Brew: https://stackoverflow.com/questions/12712017/cant-install-xdebug-on-mac-with-homebrew – Justinas May 13 '22 at 12:26
  • I have all of my project up and running with XAMPP so I would still try to fix the issue I have. Beside those errors, xdebug is still not installed. @Justinas – keymon May 13 '22 at 12:30
  • It says: ``Run: phpize (See the FAQ if you don't have phpize).``. Did you check the FAQ? – Derick May 13 '22 at 13:03

1 Answers1

0

Finally solved it and for everyone having the same issue:

On M1, your PHP can either be compiled for the x86_64 or arm64 architectures. The pecl tool can't guess which one it is, so if your PHP is compiled with say x86_64 and the default compiler setting is arm64, then you'll get the above warning. This means, that sometimes you have to run PECL with:

arch -x86_64 sudo pecl install xdebug

The arch -x86_64 part will set up the environment to compile Xdebug as x86_64 binary.

Thank you all for suppоrt!

keymon
  • 11
  • 2