2

I've just upgraded my OS to Mountain Lion and PECL is no longer working (it's on a test drive so no drama, but I'd like to get it working so I can upgrade the OS on my shiny new SSD as well).

I'm using the native PHP installation, no macports/homebrew or anything like that.

Running sudo pecl install uploadprogress (for example) produces the following terminal output:

downloading uploadprogress-1.0.3.1.tgz ...
Starting to download uploadprogress-1.0.3.1.tgz (9,040 bytes)
.....done: 9,040 bytes
4 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
autom4te: need GNU m4 1.4 or later: /usr/bin/m4
ERROR: `phpize' failed

I'm guessing the problem is the 3 grep lines. I've found several threads that suggest this is caused by XCode not being installed...but XCode is installed, and updated to the latest version (4.4). All the relevant symlinks to /Developer/usr/bin/* also exist as they should.

m4 is currently at version: m4 (GNU M4) 1.4.13, so even though the output above contains a line pertaining to it, I don't think that can be the problem.

I'm sure it's just a simple issue, anyone got any clues?

Clive
  • 131

4 Answers4

2

Try installing by the following command (modify your path accordingly), e.g.:

M4=/Developer/usr/bin/m4 pecl install uploadprogress
kenorb
  • 26,615
1

Turned out to be something ridiculously simple.

m4 is now located at /usr/local/bin/m4, something (maybe autom4te?) was looking for it at /usr/bin/m4. A quick symlink fixed the problem nicely.

Clive
  • 131
1

It turns out you might need to agree to the XCode terms and conditions for M4. To do this, run:

sudo m4 version

and if it is the first time you've run it since an upgrade you will be prompted to read and agree the terms and conditions. After this, you can use it by re-running your previously desired command.

0

It took me ages, but here is how I solved it:

  • Run:

    which autom4te
    
  • gives you the path of autom4te. In my case this was: /Applications/MAMP/Library/bin/autom4te

  • Go to that path and see if there is the program m4

  • If so, it might be corrupted. So rename it:

    mv m4 m4_old
    
  • now check where your new version of m4 is located at. So run:

     which m4
    

It gives you: /path/to/your/m4

  • Now locate a symlink in the folder of your autom4te to the original path of m4, so:

     ln -s /path/to/your/m4
    

Now it should work, running pecl

Burgi
  • 6,768
codiga
  • 101