Xdebug on macOS 10.13 with PHP 7

So macOS High Sierra 10.13 now ships with PHP 7.1. When configuring Apache, I also created a new one /etc/php.inifrom the file /etc/php.ini.default, made sure that it was loaded by PHP after restarting Apache, however, the version of the Xdebug extension that comes with macOS 10.13 does not seem to load or show at startupphpinfo();

My php.ini is definitely loading:

$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

This is what my /etc/php.ini looks like where I configure Xdebug:

[xdebug]    
zend_extension = "/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000

[Update, fixed this typo here ...]

However, Xdebug does not load and does not check and does php -inot produce results:

$php -i | grep xdebug
PHP Warning:  Method xdebug_start_function_monitor() cannot be a NULL 
    function in Unknown on line 0
    PHP Warning:  xdebug: Unable to register functions, unable to load in Unknown on line 0
    Segmentation fault: 11

And yes, the file path is correct:

$ ls /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so*

This worked in PHP 5, so I hope someone can help me and everyone else deal with this problem in the future.

When I check my apache log, I get the following error:

Failed loading /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so:  dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so, 9): Symbol not found: _xdebug_monitored_function_dtor
  Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
  Expected in: flat namespace
 in /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so

, :

Symbol not found: _xdebug_monitored_function_dtor
+11
6

, , , , ! , xdebug, macOS High Sierra ( : /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so), Zend PHP7.

, xdebug :

  • autoconf brew;
  • phpize, Zend;
  • ./configure
  • make

modules/xdebug.so

MacOS (SIP) xdebug.so /usr/lib/php/extensions/. , /usr/local/lib/php/extensions/ . , - , , , .

, php.ini, , !

+20

xcode.

, :

xcode-select --install

autoconf:

brew install autoconf

. :

  1. phpize
  2. ./configure
  3. make
  4. sudo cp modules/xdebug.so/usr/local/php/extensions ( , )

php.ini

zend_extension=/usr/local/php/extensions/xdebug.so

xdebug php.ini apache.

sudo apachectl restart
+7

"zend_extention". zend_extension. , zend_extension = xdebug.so

+4

, , , , macOS 10.13.6

0

, xDebug Mac.

: 'uint64_t'

/bin/include , . , . , , .

https://github.com/cython/cython/issues/2009

0

brew PHP, .. 7.1, 7.2 7.3, Mac OS X mojave, :

  1. brew brew install autoconf.

  2. PHP, Xdebug, brew unlink php@7.1 && brew link --force --overwrite php. PHP 7.1 PHP 7.3.

  3. Xdebug xdebug.

  4. tar Xdebug , .

  5. phpize, Zend.

  6. ./configure.

  7. make.

  8. Xdebug xdebug.so modules.

  9. /usr/local/lib/php/7.3.1/extensions/ xdebug.so . 7.3.1 - , , , PHP.

  10. php.ini zend_extension="/usr/local/lib/php/7.3.1/extensions/xdebug.so" .

  11. php -v, , Xdebug .

Xdebug PHP, , 2 11. , / Mac OS X.

0

Source: https://habr.com/ru/post/1686982/


All Articles