3

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.

user3521590
  • 111
  • 3
  • 6
  • If you use **homebrew** as your package manager, you can install a newer `m4` with `brew install m4` and be sure to put `/usr/local/bin` at the front of your PATH so the **homebrew** version of `m4` runs in preference to Apple's version. – Mark Setchell Jan 06 '20 at 20:09
  • I tried that and it gave me a waring that said **m4 is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.** So I was a little reluctant to do that. – user3521590 Jan 06 '20 at 20:24
  • The Apple one in `/usr/bin/m4` works fine. You seem to be running one that comes with MAMP. Maybe you need to move the MAMP part of your PATH **after** `/usr/bin`. – Mark Setchell Jan 06 '20 at 21:00
  • Thanks, that was the solution. Turned out to be easier than I thought. I got confused between the MAMP version and the Apple version thinking they were related for some reason. – user3521590 Jan 06 '20 at 22:02
  • Sorry how did you resolve it? – Eliasu Mar 07 '20 at 00:34
  • please can you help with a clearer understanding of what you did to resolve this – eclat_soft Oct 14 '20 at 18:14
  • For me, reinstalling m4 using homebrew and installing autoconf and automake via homebrew solved the issue. `brew install autoconf automake libtool m4` See https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15 – Ondra Koupil Sep 20 '21 at 13:07

2 Answers2

0

I've fixed similar issue by executing brew reinstall m4.

Sergey Tsypanov
  • 3,265
  • 3
  • 8
  • 34
0

In addition to a "brew (re)install m4", I had to temporarily remove "/Applications/MAMP/Library/bin" from my PATH. After that this worked for me.

John Langford
  • 1,272
  • 2
  • 12
  • 15
  • Get m4 path with: `brew info m4` Move the MAMP m4: `mv /Applications/MAMP/Library/bin/m4 /Applications/MAMP/Library/bin/m4_old` Create a link: `ln -s /opt/homebrew/opt/m4/bin/m4 /Applications/MAMP/Library/bin/m4` ^ using the path returned in first commands. – Silas Ribas Martins Jan 17 '23 at 09:02