xdebug
とは、PHPのデバッグ機能を拡張してくれるツールです。
MAMPでxdebug
を使えるようにする手順メモとして残しています。
1.php.iniを編集
php.iniを開きます。
MAMPのパスは、MAMP/bin/php/php7.4.2/conf/php.ini
のようになっています。
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php7.4.2/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebugのzend_extension=...
がコメントアウトされているので解除して、下の二行を記述します。
2.MAMPを再起動
MAMPのStop Serversで一旦切って、再起動します。
3.TOOLSで確認
MAMPのOpen WebStart pageから、TOOLS→PHPINFOを確認します。
xdebug
が表示されていればOKです。