Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixing m4 on MAC OS 10.14.5

Tags:

macos

gnu

phpize

m4

I'm having an issue with pecl which is erring out saying phpize had failed.

The problem ultimately seems to be with m4. Error is autom4te: need GNU m4 1.4 or later: /Applications/MAMP/Library/bin/m4

When I run "which m4" I get /Applications/MAMP/Library/bin/m4

However, any command I try to run with m4 like "m4 --version" I get the following:

Abort trap: 6

I can't find a good explanation of that error, but I'm guessing something is corrupted with m4, but I can't figure out how to fix this on a Mac. Do I just download a newer version and run configure, make and make install? Just a little nervous since I have somewhat limit Mac experience.

like image 447
user3521590 Avatar asked Jan 24 '26 09:01

user3521590


1 Answers

There seems to be an issue with M4 not being included in Xcode 15. For me it prompts to download an update, but this never fixes the issue.

You can then install m4 with brew.

Assuming you have installed m4 with brew you can run

brew info m4

It will tell you:

If you need to have m4 first in your PATH, run: echo 'export PATH="/opt/homebrew/opt/m4/bin:$PATH"' >> ~/.zshrc

echo 'export PATH="/opt/homebrew/opt/m4/bin:$PATH"' >> ~/.zshrc

setting the brew version of m4 to be first in my path resolved the issue for me.

like image 119
Duan Gauche Avatar answered Jan 26 '26 10:01

Duan Gauche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!