PHP 5.6 upgrade compiled old extensions

2019-09-16 12:34发布

问题:

I have just upgraded my PHP version from 5.5 to 5.6 using brew (I am on OSX 10.10 Yosemite) and after some configuration everything works fine except for some of my PHP extensions. I am trying to fix this but when I run php -v, I get the following PHP warning:

Xdebug requires Zend Engine API version 220121212. The Zend Engine API version 220131226 which is installed, is newer. Contact Derick

Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.

PHP Warning: PHP Startup: igbinary: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0

Warning: PHP Startup: igbinary: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: intl: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0

Warning: PHP Startup: intl: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: mcrypt: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0

Warning: PHP Startup: mcrypt: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 PHP 5.6.22 (cli) (built: Sep 15 2016 18:47:34) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

I thought then that if I edit my php-config and change the following:

extension_dir='/usr/lib/php/extensions/no-debug-non-zts-20121212'

To

20131226

Then perhaps that would resolve the issue however I don't have a 20131226 folder under /usr/lib/php/extensions/.

I am just wondering as to what I can do to upgrade my zend engine or add this folder as it seems my extensions are still running against my old PHP 5.5 install but I don't see any extension for PHP 5.6 and am not too sure how to add them in this case.

Also just to note, I installed using brew namely:

brew install --without-apache --with-fpm --with-mysql php56

Thanks

回答1:

My mistake, in order to fix this, I had to remove all the old conflicting extensions like so:

brew uninstall php55-mcrypt php55-xdebug php55-intl php55-igbinary

and then reinstall them and build from source using:

brew reinstall php56-xdebug php56-intl php56-igbinary php56-mcrypt --build-from-source