Xdebug on macOS 10.13 with PHP 7
Ok so I finally got it running myself it works perfectly! I'm assuming that the xdebug binary that comes with macOS High Sierra (found under: /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
) is not compatible with PHP7's new Zend engine.
So I downloaded the latest source from the xdebug website and did the following:
- Installed autoconf with brew;
- Run
phpize
to configure the build for the new Zend engine; - Run
./configure
- Run
make
modules/xdebug.so
However macOS System Integrity Protection (SIP) will prevent you from overwriting the xdebug.so
under /usr/lib/php/extensions/
. I didn't want to disable this so I created a new directory path under /usr/local/lib/php/extensions/
and copied the new binary to this location. I'm not sure if this directory is the best place to put it or if this is bad practice but it worked for me.
Finally I reconfigured my php.ini to use the new binary and everything worked perfectly!
How to setup XDebug for PHP7 on Mac?
As stated by Homebrew, Homebrew/php tag was deprecated.
So it's not possible to install xdebug through Homebrew anymore. Please use PECL instead: https://xdebug.org/docs/install#pecl
How to use xdebug with MAC High Sierra standard installation
The solution:
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
Then I copied xdebug.so into my extension directory. XDebug not working on MacOS High Sierra : Symbol not found: _xdebug_monitored_function_dtor
look at this answer: https://stackoverflow.com/a/46623845/6540060
you need to compile your own xdebug.so
macOS 10.13 Server app v5.6 PHP Downgrade From 7 to 5
I do not recommend downgrading the version, I would install PHP 5.6 using homebrew and then just having both versions installed.brew install php56
This will be symlinked from /usr/local/Cellar/php56
into /usr/local/bin
and as long as this in in your $PATH
then you should be able to use PHP 5.6 without overriding 7
Failed-loading xdebug installation - xdebug.so, 9 no suitable image found
I sorted the problem out by adding
export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
on .bash_profile.PHP 7.1 came with OSX 10.13.2, so default path was set to the pre-packed php, which shows the error on phpinfo.
Related Topics
Codeigniter 4 Problem Installing with Composer
How to Prevent PHP Script Running More Than Once
PHP to Easyphp MySQL Server 1 Second Connection Delay
PHP Flush() Not Working in Chrome
Efficient Reloading Data/Pushing Data from Server to Client
In a PHP5 Class, When Does a Private Constructor Get Called
How to Connect an Oracle Database from PHP
PHP Displaying Unread Mail Count
PHP - Get Array Value with a Numeric Index
Maximum Function Nesting Level of '100' Reached, Aborting After Upgrading to Laravel 5.1
PHP Warning: Unknown: Input Variables Exceeded 1000
PHP - Swiftmailer Using Starttls and Self Signed Certificates