Search code examples
phpcommand-line-interfacemamp

CLI MAMP PHP running slowly compared to OS X PHP


Ive just started to encounter a problem with MAMP PHP running extremely slowly. Ive reinstalled MAMP and still having issues.

As a comparison (I thought maybe my local development OS X machine may have been having issues) i tried the following in terminal, and disabled php.ini with -n

/usr/bin/php --version -n

This returns with an output immediately.

/Applications/MAMP/bin/php/php5.5.14/bin/php --version -n 

This returns an output approx 3-5 seconds later.

I have tried running numerous other commands and scripts. All seem to have a delay of 3-5 seconds with MAMP PHP.

I have tried other MAMP PHP versions, and they still have the same issues.

I can't think of anything that has changed recently on my machine to cause this slow down (e..g no php.ini changes, no OS X updates)

I really have no idea whats causing this problem, or even how to investigate things further. Help greatly appreciated.

UPDATE

Strangely, the problem only seems to be when running MAMP PHP in command line. When loading a website using MAMP, there is no slow down. Even more confusing...


Solution

  • Solved. For some reason -n was not removing the .ini files. Deleting the .ini file altogether solved the issue.

    Some googling lead me to the extension causing the issue. I commented out the following line in my .ini file

    ; extension=imap.so