Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bencarter78@hotmail.com's avatar

Upgrading OSX to php 5.6 problems

Hi all

I know this isn't a Laravel problem but I'm just at my wits end trying to sort this. My tests were running so slow on Homestead that I needed a solution on my host machine but in order to run the tests I needed my version of php upgrading on my Mac.

I am using Homebrew to update php and I thought it had done it but since I did when I run my tests I get the following message in the terminal.

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

The tests still run but I want to run the tests through PhpStorm now and this message is causing them to not run them.

I've googled and I think I understand what the issue is but I have no idea how to fix it.

I've seen something saying "Check what the output of "phpize" is when you're completing the compilation steps. The number that you're looking for is on the line that says "Zend Extension Api No"."

When I run phpize it just says

Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

But I don't know what it's referring to as "top level source directory of the module"

Can anyone give me any ideas?

I'm running Yosemite

0 likes
6 replies
ohffs's avatar

@bencarter78 you run phpize in the source tree for xdebug. You could also disable xdebug if you don't use it.

andy's avatar

Is "usr/local/bin" in your path?

@ohffs +1 I disable xdebug, normally. It, for some reason, cause me more trouble than it's worth. lol. I can't remember the last time I used it.

hmmm, homestead.

I don't normally use homestead or any other vagrant box because OSX is already a server, so why add another ram eating application? The benefit of using vagrant when using OSX is when you need the convenience of having an environment that is almost the same as your target deployment host.

cimrie's avatar

Hi @bencarter78

Literally had the same issue just yesterday. I haven't managed to get rid of the message but I can now run tests in phpstorm, which is more convenient for me.

I'm recalling this from memory so the solution might not be a perfect match. Hopefully you can still use the info:

Effectively I used homebrew to upgrade xdebug:

brew install php56
brew install homebrew/php/php56-xdebug

If it asks, just run the unlink command with any current PHP and then the opposite link command with the php56 version.

In PHPStorm I then went to Preferences > Languages & Frameworks > PHP. Select 5.6 from the dropdown.

Interpreter seems to want to use the default with Mac (5.5 on mine). I have just kept it to that. If you click the three dots it brings up the settings for the interpreter. There is an info bit for 'configuration file' - if that is missing then do the following:

Get the location of your current ini file in terminal using:

php --ini

copy the file to /etc/php.ini

cp /path/to/your/ini /etc/php.ini

Then add this line at the top of the php.ini file:

[PHP]
zend_extension="/usr/local/Cellar/php55-xdebug/2.3.3/xdebug.so"

Let me know how you get on after trying to run tests with that set up. If you get any errors (hopefully they have at least changed error) let me know and I can see if I know how to fix them :)

bencarter78@hotmail.com's avatar

@andy yes I've got that in my $PATH.

@CImrie When I followed your instructions it said that the module was already loaded so I ran php -i and saw that there was an xdebug ini file being loaded so I edited the zend_extension path to my homebrew one but I still get the same error when running php -v.

I have a feeling that when php56-xdebug is being installed by homebrew it is using the wrong phpize when compiling. I just think that from the 10,000 articles I seem to have read about it today! I have precisely ZERO knowledge regarding this though.

cimrie's avatar

@bencart78

Yeah I am not sure but I think I have about 3 different versions of PHP on my system after it all haha. The reason I mentioned the interpreter settings in PHPStorm was because it seems to run off an entirely separate php.ini file (at /etc/php.ini). And so even if your terminal can find xdebug, PHPStorm won't, unless you include a reference to xdebug.so in the /etc/php.ini file. I would not include the zend_extension line in your normal php.ini file as it is likely already loaded (and even suggested by your prev post).

Not sure how much help this is.

Please or to participate in this conversation.