Saturday, April 20, 2024

xdebug on Mac

…asdf

I'm using WAMP on my Windows PC, so I wanted something similar on my Mac. The most recommended stack i XAMPP and I was evaluating it for my PC as well, so I didn't look much further.

What I didn't know at that time and still amazes me is Apache and PHP are actually present in standard MacOS! So you basically only need to enable and configure them, plus install MySQL or MariaDB. With this knowledge some steps started making sense, because they're all about pointing to the “right” (XAMPP) version of PHP.

Open Terminal

Ensure XAMPP's PHP is being used. Modify your PATH to prioritize the PHP installation from XAMPP:

  1. export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"

This step is necessary for phpize command to work. I originally skipped it and then I got command not found: phpize error.

check php version

  1. php -v

apple silicon

  1. brew install autoconf automake libtool

add path

  1. arch -x86_64 sudo pecl install xdebug

asdf

download and prepare xdebug

  1. git clone https://github.com/xdebug/xdebug.git cd xdebug phpize

Configure and compile Xdebug:

  1. ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config make sudo make install

asdf

  1. nano /Applications/XAMPP/xamppfiles/etc/php.ini

asdfas

  1. [xdebug] zend_extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-<php-version>/xdebug.so" xdebug.mode=debug xdebug.start_with_request=yes xdebug.client_host=localhost xdebug.client_port=9003

asdf

  1. sudo /Applications/XAMPP/xamppfiles/bin/apachectl restart

asdf

Verify the installation. Create a phpinfo.php file in your web root directory with the following content:

  1. <?php phpinfo(); ?>

Access this file via your web browser (e.g., http://localhost/phpinfo.php) and look for the Xdebug section to confirm it is loaded correctly.

Friday, April 5, 2024

ReQuiky

With another device in use I have no other choice than to finally follow through on content sync in Quiky

Sync