12
Build and install APC extension on Mac OSX 10
If you tried to install the APC extension on the MAC and got the following error:
pecl mac error: ‘apc_regex’ has no member named ‘nreg’
The problem is that APC depends on the PCRE library and we need to install it before compiling APC. Here is how to fix it!
- Open a TERMINAL session, type : mkdir temp
- Head up to this page and download a PCRE library (try to use the latest one). I took pcre-8.12.zip, put the file inside the temp directory
- uncompress the PCRE archive via Finder (or any other way)
cd pcre-x.xx replace x with the version number (example: cd pcre-8.12)
./configure
make
sudo make install
- now download the latest APC release (link here)
- uncompress the APC archive via finder (or terminal by typing   tar zxf APC-X-XX replace X with archive name and version number )
- type
cd ~/temp/APC-3.1.9Â Â Â (change the version number if you're using something different)
phpize
./configure
make
sudo make install
you should see something similar to this when it’s done compiling
Installing shared extensions:Â Â Â Â /usr/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files:Â Â Â Â Â Â Â Â Â /usr/include/php/
Modify your php.ini file to have the extension loaded at php startup
- Open /private/etc/php.ini  (in Finder, select GO menu, select GO TO FOLDER and type /private/etc)
- add this line in the Dynamic extensions area
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so
Restart the web server (reboot your machine if your lazy, or go into the System preferences, click on Sharing, un-select Web sharing , wait a few seconds and select it again )
You’re done, congrats!
Note:
There is a bug in version APC 3.1.9Â
if you get error
Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0
Relax! just modify the file apc_lock.h inside the APC folder you created. Edit the following line around lines 155-160
Find the following:
# define apc_lck_rdunlock(a) apc_fcntl_unlock(&a TSRMLS_CC)
Replace by the following
# define apc_lck_rdunlock(a) apc_fcntl_unlock(a TSRMLS_CC)
Recompile APC by doing:
cd ~/temp/APC-x-xx (replace X with version number) make clean phpize ./configure make sudo make install
And restart your web server! Too easy ! enjoy!
13
Fixing SMB issue with Mac OSX 10.6.3 update
You may have noticed problems when trying to save/write/create/delete stuff on a SMB share after updating your Mac to update 10.6.3. The quick turn around is to edit the smb.conf file (usually find in /etc/samba/smb.conf) and add this line in the [GLOBAL] section:
unix extensions = no
restart samba and it will work again!
to restart SAMBA: /etc/init.d/samba restart



