开发者

how to install apc for php on mac osx mamp?

I am running a mac with mamp and mamp pro. How do I check if I have APC enabled and if its not enabled or not installed how do I install it?

I am trying to get the APC upload loader to work that I found online and it gets stuck on NAN% when im uploading.

This is a link: http://www.haughi开发者_运维技巧n.com/2007/10/23/php-upload-progress-with-php-52-apc/


There's nothing to download or install. MAMP 1.9 includes APC already. To enable it, open Preferences/PHP. Uncheck 'Zend Optimizer' (because it's not compatible with APC), then choose APC from the 'Cache' drop-down box, submit the change with 'OK'.


In MAMP 2.1 you can find the APC setting in the Main Window under Server > PHP > Cache:

how to install apc for php on mac osx mamp?

In MAMP 3.0 APC is found on the PHP tab:

how to install apc for php on mac osx mamp?


For command-line support add also the following lines to your MAMP php.ini:

[apc] extension=apcu.so apc.enable_cli=1


Visit the phpinfo page that you can get to from inside the MAMP start page. That lists all of the loaded modules.

Here are the install steps for PHP-APC:

link text

You may be able to run pear or pecl inside MAMP to do the install easily.


Do it manually:

1- nano /Applications/MAMP/bin/php/php5.6.2/conf/php.ini

NOTE: "php5.6.2" on the path should be changed to the php version you'll be using.

2- Look for the section:

[OPcache] ;zend_extension="/Applications/MAMP/bin/php/php5.6.2/lib/php/extensions/no-debug-non-zts-20131226/opcache.so"

3- Remove the colon (;) so that section reads:

[OPcache] zend_extension="/Applications/MAMP/bin/php/php5.6.2/lib/php/extensions/no-debug-non-zts-20131226/opcache.so"

4- Save (Ctrl-O) + Enter and quit (Ctrl-X)

Enjoy.

When running PHP scripts from the Console (CLI) you will need to specify the PHP binary you want to use since by default php will be the default PHP included with OS X, not the one installed with MAMP.

So instead of:

user$ php script.php

try:

user$ /Applications/MAMP/bin/php/php5.6.2/bin/php script.php
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜