1

I have a problem with pcntl installation. My PHP version is 5.4.4, I followed this tutorial: http://cyberpunx.com/2011/11/pcntl-so-on-osx-lion-and-mamp/

But Pcntl does not load. In php error log I see:

[04-Sep-2012 22:58:16 UTC] PHP Warning: PHP Startup: pcntl: Unable to initialize module Module compiled with module API=20090626 PHP
compiled with module API=20100525 These options need to match

How can I compile pcntl correctly? Thank you for your help!

TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
Martin Strouhal
  • 1,174
  • 1
  • 12
  • 23
  • Refer: [http://stackoverflow.com/questions/5230255/how-to-enable-process-control-extension-pcntl-in-php-mamp](http://stackoverflow.com/questions/5230255/how-to-enable-process-control-extension-pcntl-in-php-mamp) – Suriyamoorthy Baskaran Sep 26 '12 at 08:47

2 Answers2

2

The most likely scenario is that after the upgrade you forgot to update your php.ini to change the extension_dir.

If you have followed the tutorial to the letter, your extension_dir should be:

/usr/local/lib/php/extensions/no-debug-non-zts-20100525

Also, don't forget to restart Apache after your php.ini changes.

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
2

Finally, my solution was completely different. I removed MAMP and activated OSX built-in apache and installed MySQL.

This tutorial helped me a lot: https://apple.stackexchange.com/questions/23751/how-to-turn-mac-os-x-lion-into-a-web-server

Then I followed this: http://cyberpunx.com/2011/11/pcntl-so-on-osx-lion-and-mamp/

...and finally got pcntl working!

//EDIT:

another very easy solution is to download precompiled PHP for mac: http://php-osx.liip.ch/

Community
  • 1
  • 1
Martin Strouhal
  • 1,174
  • 1
  • 12
  • 23
  • Hi Martin, glad everything is working for you. But the question was explicitly for MAMP so we need to get answer for MAMP rather then changing our environment. If possible could you please un-accept your answer. Thanks :) – TeaCupApp Sep 27 '12 at 22:23
  • @Owl pity that the bounty expired over this answer :( – Ja͢ck Oct 04 '12 at 02:32
  • @Jack, Sorry mate. I got stuck with work and completely forgot :(, HOwever I haven't tested your answer though. I hope Martin has given a shot before he changed the environment. – TeaCupApp Oct 04 '12 at 06:09
  • @Owl I couldn't test it myself either, because I mainly develop on Win :) – Ja͢ck Oct 04 '12 at 06:26