Snow Leopard PHP Extensions Installation Tutorial

By Xeon Xai  

This will help you to setup imagick, magicwand, xdebug, mcrypt and memcached for Snow Leopard’s bundled PHP 5.3.0. Please do expect the installation of ImageMagick to take a bit of time, as it requires a large number of packages. I’m doing it all my preferred way. If you have another way that is faster or better, I’d be glad to take your suggestions and make this tutorial more streamlined.

Step 1:

Make sure you have XCode 3.2 for Snow Leopard installed, from the Snow Leopard install DVD.

Step 2:

Download MacPorts for Mac OS X 10.6 Snow Leopard here.

If you have previously installed MacPorts and installed software with it in Mac OS X 10.5, run this first to remove it, as it won’t work in Snow Leopard anymore.

In Terminal:

sudo rm -rf /opt/local \
/Applications/MacPorts \
/Applications/DarwinPorts \
/Library/Tcl/macports1.0 \
/Library/Tcl/darwinports1.0 \
/Library/LaunchDaemons/org.macports.* \
/Library/StartupItems/DarwinPortsStartup \
/Library/Receipts/MacPorts*.pkg \
/Library/Receipts/DarwinPorts*.pkg \
~/.macports

Step 3:

Open the MacPorts-1.8.0-10.6-SnowLeopard.dmg file, and install the MacPorts package file.

Step 4:

To hide the /opt folder from Finder view that is visible after installing MacPorts.

In Terminal:

sudo chflags hidden /opt

Step 5:

By default, MacPorts for Snow Leopard should use x86_64 arch instead of ppc/i386, so you shouldn’t have to worry much here.

This part most likely will take the longest of all things in the tutorial, as it requires a large group of individual packages. You can cook dinner, eat it, and you might still be waiting for this to complete after you’ve finished eating. It took about a half hour for it to complete on my MacBook.

In Terminal:

sudo port install imagemagick

Step 6:

Download imagick here.

Unpack the file imagick-2.3.0.tgz.

In Terminal:

cd ~/Downloads/imagick-2.3.0/imagick-2.3.0
phpize
./configure --with-imagick=/opt/local
make
cd modules
sudo cp imagick.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Step 7:

Download magickwand here.

Unpack the file MagickWandForPHP-1.0.8.tar.gz.

In Terminal:

cd ~/Downloads/MagickWandForPHP-1.0.8/
phpize
./configure --with-magickwand=/opt/local
make
cd modules
sudo cp magickwand.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Step 8:

Download xdebug here.

Unpack the file xdebug-2.0.5.tgz.

In Terminal:

cd ~/Downloads/xdebug-2.0.5/xdebug-2.0.5
phpize
./configure
make
cd modules
sudo cp xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Step 9:

In Terminal:

sudo port install libmemcached

When it completes, type this into Terminal:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.memcached.plist

Step 10:

Download memcached here.

Unpack the file memcached-1.0.0.tgz.

In Terminal:

cd ~/Downloads/memcached-1.0.0/memcached-1.0.0/
phpize
./configure --with-libmemcached-dir=/opt/local
make
cd modules
sudo cp memcached.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Step 11:

Download libmcrypt here.

Unpack the file libmcrypt-2.5.8.tar.bz2.

In Terminal:

cd ~/Downloads/libmcrypt-2.5.8/
./configure --disable-posix-threads --enable-static
make
sudo make install

Step 12:

Download PHP 5.3.0 source code for the mcrypt extension here.

Unpack the file php-5.3.0.tar.gz. We will only need to use the code within the ext/mcrypt directory. No need to compile all of PHP for this.

In Terminal:

cd ~/Downloads/php-5.3.0/ext/mcrypt
phpize
./configure
make
cd modules
sudo cp mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Step 13:

In Terminal:

cd /etc
sudo cp php.ini.default php.ini
sudo pico php.ini

Search for:

display_errors

Set this to:

display_errors = On

Search for:

html_errors

Set this to:

html_errors = On

I placed the following after all the commented out lines for extensions:

;;;;;;
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/memcached.so
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
xdebug.default_enable = On
xdebug.collect_params = 4
xdebug.trace_format = 1
xdebug.show_local_vars = On
xdebug.dump_globals = On
xdebug.show_exception_trace = On
xdebug.collect_assignments = 1
;;;;;;

Set your default timezone. I’ll show mine as an example.

date.timezone = America/New_York

Set your mysql default port.

mysql.default_port = 3306

Press Control-X to exit, it will ask if you want to save changes, so press Y for Yes, and press Enter save and exit completely.

Step 14:

Restart Apache.

In Terminal:

sudo apachectl graceful

That should do it, as this is the exact steps I took to install all of these just now. And everything worked for me just as typed.

Hope this helps you out.

Enjoy.

VN:F [1.9.22_1171]
Rating: 9.7/10 (24 votes cast)
VN:F [1.9.22_1171]
Rating: +12 (from 16 votes)
Snow Leopard PHP Extensions Installation Tutorial, 9.7 out of 10 based on 24 ratings

62 Comments

  1. Posted September 2, 2009 at 3:58 PM | Permalink | Reply

    Thank you. You saved me alot of heartbreak w/ this tutorial.

    VA:F [1.9.22_1171]
    Rating: 3.5/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: +2 (from 4 votes)
    • Posted September 14, 2009 at 12:51 AM | Permalink | Reply

      Are their any other extensions you wish I should include with my tutorial?

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
      • Logan
        Posted November 12, 2011 at 1:43 PM | Permalink | Reply

        Awesome! Take a bow. It would be wonderful if you add few lines on how to upgrade php or remove the existing version and building a new one with macports.

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
        VA:F [1.9.22_1171]
        Rating: -1 (from 1 vote)
  2. emehrkay
    Posted September 2, 2009 at 4:27 PM | Permalink | Reply

    Thank you very very much. This is a great walk through. The timezone setting didnt work for me. I had to define it as:

    date.timezone = Etc/GMT-5

    Otherwise I’d get the error (in the php.ini):

    Warning: phpinfo(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
    • Posted September 14, 2009 at 12:54 AM | Permalink | Reply

      Do you have any suggestions for other PHP extensions I should include?

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  3. Posted September 2, 2009 at 5:02 PM | Permalink | Reply

    Xeon Xai,

    You are an inspiration to us all! Love the blog.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  4. Shock Stream Thunder
    Posted September 2, 2009 at 5:29 PM | Permalink | Reply

    Perfect! Just the help I needed. Saved me days. Thanks!

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
    • Posted September 14, 2009 at 12:52 AM | Permalink | Reply

      If you need help with any other extensions, let me know and I will include them here.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  5. Dennis Redies
    Posted September 3, 2009 at 7:42 PM | Permalink | Reply

    Is anyone else having problems with Xdebug were the values of variables are be displayed as Uninitialized when you are inside a function?

    VA:F [1.9.22_1171]
    Rating: 1.0/5 (1 vote cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted September 14, 2009 at 12:50 AM | Permalink | Reply

      Dennis Redies, can you give more detail on your xdebug issues?

      Thanks,

      Xeon Xai

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  6. Posted September 6, 2009 at 6:01 PM | Permalink | Reply

    Hi Xeon

    Thanks for your tutorial (PHP extension) , it help me to solved an issue I had with phpMyAdmin & SL…(I am not PHP dev, rather RubyOnRails… but I like phpMyAdmin)
    On you advice I bought VirtualHostX …

    Do you mind if I translate your tutorial into French for non-english readers ? it will be my FIRST article on my FIRST blog ….

    Yves

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  7. Posted September 6, 2009 at 6:28 PM | Permalink | Reply

    Mahalo so much for posting this—I’d been using some beta instructions for a couple of servers up until the official release last week, and this is the first, “official” 10.6 release instructions I’ve seen, and they were tremendously helpful. You shoud post a PayPal link on this page for people (like myself) for donations.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
    • Posted September 14, 2009 at 12:46 AM | Permalink | Reply

      I’m always happy to help.

      VN:F [1.9.22_1171]
      Rating: 5.0/5 (1 vote cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  8. cirpo
    Posted September 10, 2009 at 7:12 PM | Permalink | Reply

    APC:

    * Install pcre lib with macports
    * download the appropriate version of the APC package http://pecl.php.net/package/APC
    * Unpack it
    * cd APC*
    * Run phpize
    * MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=”-arch x86_64 -g -Os -pipe -no-cpp-precomp” CCFLAGS=”-arch x86_64 -g -Os -pipe” CXXFLAGS=”-arch x86_64 -g -Os -pipe” LDFLAGS=”-arch x86_64 -bind_at_load” CPPFLAGS=”-I/opt/local/include” ./configure
    * cd modules
    * sudo cp apc.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

    enjoy

    cirpo

    VA:F [1.9.22_1171]
    Rating: 3.8/5 (4 votes cast)
    VA:F [1.9.22_1171]
    Rating: +2 (from 4 votes)
    • ldg
      Posted October 18, 2009 at 4:40 PM | Permalink | Reply

      @cirpo, thanks for the APC entry. A couple issues I experienced:

      * I needed to soft-link to the pcre.h file, i.e., “ln -s /opt/local/include/pcre.h /usr/include/php/ext/pcre/”

      * you also might need to add “–with-pcre-regex=/opt/local/include” AND/OR “–with-pcre-dir=/opt/local/include” to the .configure command.

      * and don’t forget to run “make” :)

      VA:F [1.9.22_1171]
      Rating: 3.0/5 (2 votes cast)
      VA:F [1.9.22_1171]
      Rating: +1 (from 3 votes)
  9. Posted September 13, 2009 at 6:30 AM | Permalink | Reply

    Dude… you are a god my friend. Been trying to figure this out for days now. So happy to not have to use Entropy anymore.

    Big thanks!!!

    pali

    VA:F [1.9.22_1171]
    Rating: 3.5/5 (4 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 3 votes)
    • Posted September 14, 2009 at 12:46 AM | Permalink | Reply

      Thanks, if you have any troubles with any other extensions you want, let me know.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  10. Eli
    Posted September 15, 2009 at 5:16 PM | Permalink | Reply

    Thanks for the wonderful tutorial! I am almost through this upgrade to 10.6.

    However I am having one problem with libmcrypt-2.5.8.

    I get the following error after attempting to run the ‘make’ command while building this module:

    make[2]: *** [libmcrypt.la] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2

    Do you have any idea what I might be doing wrong?

    Thanks!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  11. Rasmus
    Posted September 16, 2009 at 2:01 AM | Permalink | Reply

    Can’t thank you enough for this tutorial!

    An addition could be GhostScript. I got it working by:
    sudo port install ghostscript

    And then making an alias for Apache:
    sudo ln -s /opt/local/bin/gsc /usr/bin/gs

    Had no idea what I was doing but I got it working. :)

    It would also be helpful if you would note what differs Leopard from Snow Leopard installation. And if there is anything to keep in mind when installing on OS X Server instead of OS X.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 3 votes)
  12. cismorov
    Posted September 17, 2009 at 5:39 PM | Permalink | Reply

    well done! you saved some hours

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  13. Posted September 19, 2009 at 5:47 AM | Permalink | Reply

    Forgive me for asking, but why not just install and manage PHP5 through macports? macports has ports for php5, php5-xdebug, php5-apc, etc.

    Another question I have is why did you use macports to install some libraries, like imagemagick, but then compile from source like libmcrypt?

    That being said, this does give a great overview of how to compile php extensions and the many ways of integrating libraries into php. These techniques are good too if you ever need to make extensions for ZendServer on OSX as well.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  14. Josh
    Posted September 28, 2009 at 2:39 AM | Permalink | Reply

    i think i really need you help, sorry.. i’m totally new in this and i was trying to make work php in my imac and i did but when i get to the point to try to test phpbb in my localhost i get really confused.

    i followed this steps http://wiki.phpbb.com/Localhost to make a test in my localhost but when i tried to make a database i couldn’t because mcrypt then i search in the web and i found your post, and i follow your steps. but i don’t know why it didn’t work. can you give me an advice?i will appreciate it a lot this tuesday i will make a clean install of snow leopard so i [please if you can] can you tell me how to achieve what i want?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  15. Posted September 29, 2009 at 2:46 AM | Permalink | Reply

    I actually used PECL to install imagick.

    You’ll still need to install ImageMagick via MacPorts but after that step install pear-pecl using the go-pear.php script. (http://pear.php.net/go-pear).

    After those are both run go to /usr/local/bin and run

    pecl install imagick

    When it asks you for the ImageMagick installation folder tell it to look in /opt/local

    Make sure and add the imagick extension to your php.ini, mine looks like:

    extension=imagick.so

    I’ve found this method to be much easier and you’ll avoid steps 6-13.

    Hope that helps somebody.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 3 votes)
  16. Posted October 2, 2009 at 6:20 AM | Permalink | Reply

    Great article, worked excellent for me. I also installed ghostscript.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  17. Johan
    Posted October 21, 2009 at 12:00 PM | Permalink | Reply

    Wow!!! I’m so grateful for this. Thanks a lot for sharing! –Blog goes straight into rss-reader :)

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  18. Posted November 8, 2009 at 6:56 AM | Permalink | Reply

    Really great work, thank you very much for having spent your time to help us.
    It worked like a charm with only copy/paste actions.

    Thank you,
    Chris

    Mac OS X 10.6.1
    Xcode 3.2.1

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  19. Chris Ridenour
    Posted November 13, 2009 at 4:13 AM | Permalink | Reply

    It sure was nice to get rid of phpmyadmin’s complaint of no mcrypt! Thanks for the great tutorials.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  20. Posted November 25, 2009 at 1:01 AM | Permalink | Reply

    Thank You very much. Not only did this solve my mcrypt issue but gave me insight to a few other things. Worked perfectly. I found a couple differences however.

    1. MacPorts-1.8.0-10.6-SnowLeopard.dmg – I found it to be MacPorts-1.8.1-10.6-SnowLeopard.dmg now

    2. cd ~/Downloads/xdebug-2.0.5/xdebug-2.0.5 & cd ~/Downloads/memcached-1.0.0/memcached-1.0.0/ – I did not have a second level dir just ~/Downloads/xdebug-2.0.5 & cd ~/Downloads/memcached-1.0.0

    Thank you again for your great post!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  21. incolor
    Posted January 2, 2010 at 8:30 PM | Permalink | Reply

    Freakin’ fantastic! This has saved me a lot of headaches. Thank you so much.

    Would you consider adding a robust version of gd2 to the mix? (The 10.6 Server version does not include Freetype, which is causing me some problems. I thought your inclusion of ImageMagick was going to solve those, but it hasn’t.)

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  22. Christian
    Posted January 10, 2010 at 8:08 PM | Permalink | Reply

    Thanks for the tutorial. It really helped my out.
    One question: How do you know when to add –with-MODULE_NAME=/opt/local to ./configure?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted January 10, 2010 at 9:29 PM | Permalink | Reply

      The -with-module-name=/opt/local is for when you have to use a binary file in that directory, or the directory that you tell it to find the binary and lib files it will need to link to.

      Not all will require it. Things like imagick or magicwand will need it. Though most will not unless they need to link to a static binary or lib file.

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VA:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  23. gettext php module
    Posted January 11, 2010 at 4:02 AM | Permalink | Reply

    Hi,

    Thanks for this tuto that save me lot of time and stress :-) Btw, I tried to used this method to compile and install the gettext extension in php but it doesn’t seem to work.
    Do you know if this method can be used ? Have you tried with the gettext php extension ?

    Thanks a lot for all this work.
    Nico

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  24. Christian
    Posted January 12, 2010 at 6:51 PM | Permalink | Reply

    @ Xeon Xai: Tanks for the reply.

    @ #23: I was actually using this tutorial because I needed to install gettext :-)

    I think what i did was:

    $ sudo port install gettext
    $ cd ~/Downloads/php-5.3.0/ext/gettext
    $ phpize
    $ ./configure –with-gettext=/opt/local
    $ make
    $ cd modules
    $ sudo cp gettext.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
    $ sudo apachectl graceful

    I’ve tried many things to get it to work but I think this is what finally made it. But don’t just copy/paste this. It might contain typos. Of course you need to download php first.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Pepsi92
      Posted January 16, 2010 at 2:31 PM | Permalink | Reply

      Thanks for your help.

      I tried your procedure and :
      - compile ok
      - install ok
      - loaded in php ok (phpinfo() reports it as enabled)

      but it does not work :-(, at least with Gallery 2.3.1

      When I install gallery, I have the following message during the gettext test :

      Your PHP is missing the function ‘bind_textdomain_codeset’. This means Gallery may display extended characters for some languages

      An idea ?

      Tks
      Nico

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VA:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
      • Posted January 22, 2010 at 10:43 AM | Permalink | Reply

        I also need to get the function bind_textdomain_codeset enabled, or in some way working! Gettext now is enabled, but it does not show my local norwegian characters properly! Anybody?

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
        VA:F [1.9.22_1171]
        Rating: -1 (from 1 vote)
  25. Zo
    Posted January 25, 2010 at 10:32 AM | Permalink | Reply

    This is great, exactly what I needed!

    Thanks very much :)

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted January 31, 2010 at 12:02 AM | Permalink | Reply

      Thanks for reading and enjoying the work.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  26. Eric Smith
    Posted February 2, 2010 at 4:38 PM | Permalink | Reply

    Awesome tutorial! Thanks so much, saved me a ton of time and energy. Any chance you can add the zip extension to your tutorial.

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  27. Joy
    Posted February 8, 2010 at 6:56 PM | Permalink | Reply

    Thank you for this great information. I’d like to know where you learned how to install the PHP extensions. Is this in the PHP documentation?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted February 11, 2010 at 10:17 PM | Permalink | Reply

      I learned all my PHP extension skills from working with PHP and Mac OS X for many years. Installation for PHP extensions vary slightly for each operating system and configuration. You can read more about it in the PHP.net site docs.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  28. Posted February 17, 2010 at 11:55 AM | Permalink | Reply

    I’m having trouble getting imagick to install with MAMP. The imagick.so file that is compiles is x86_64 and I think MAMP requires a universal or i386. Any tips on how I might be able to overcome this issue? When I start MAMP, my PHP log says:
    [17-Feb-2010 10:42:48] PHP Warning: PHP Startup: Unable to load dynamic library ‘/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/imagick.so’ – (null) in Unknown on line 0

    This is also happening with magickwand.so

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  29. Dasani
    Posted March 21, 2010 at 10:24 PM | Permalink | Reply

    Dude…I love you. This tut was AMAZING.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted April 4, 2010 at 12:53 PM | Permalink | Reply

      Thanks.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  30. Posted March 23, 2010 at 5:37 PM | Permalink | Reply

    This was really helpful… Indeed that mcrypt messahe on phpMyadmin was quite annoying. However I got a new error on PhPMyAdmin:

    Your PHP MySQL library version mysqlnd 5.0.5-dev – 081106 – $Revision: 1.3.2.27 $ differs from your MySQL server version 5.0.45. This may cause unpredictable behavior.

    Any thoughts on how to attack that?
    I am running a LAMP installation on Snow Leopard…

    Thanks!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted March 24, 2010 at 5:20 PM | Permalink | Reply

      I never worry about if the 5.0.45 or whichever version doesn’t match the internal PHP MySQL ND drivers. It won’t really cause any issues. If you wanted to make them match, you would have to recompile your PHP binary to use the same version of mysql you are using, or create an extension using the same core mysql as your server revision is. Though I’ve been using 5.0.5-dev mysqlnd along side mysql server 5.0.45 or others, and it has not caused any issues.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  31. Cody
    Posted April 1, 2010 at 7:08 PM | Permalink | Reply

    Is anyone having issues with 10.6.3? I can’t tell if it’s this zencart install or if everything is messed up. I keep getting segmentation faults.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
    • Posted April 4, 2010 at 12:52 PM | Permalink | Reply

      I haven’t been having any problems with 10.6.3 with Apple PHP 5.3. Everything seems to be fine for me.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
      • Cody
        Posted April 12, 2010 at 2:32 PM | Permalink | Reply

        Something is definitely messed up on my end. It was working fine on 10.6.2. But randomly I’ll hit refresh on my php scripts and firefox tries to download them. Along with a segmentation fault in the Error Log.

        [Mon Apr 12 11:29:02 2010] [notice] child pid 869 exit signal Segmentation fault (11)

        After that happens it will start to behave as normal, just randomly does this.

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
        VA:F [1.9.22_1171]
        Rating: -1 (from 1 vote)
  32. Posted April 10, 2010 at 6:39 PM | Permalink | Reply

    Dude, thank you soooooo much. I have been wanting imagick on my mac for so long. This tutorial is totally wicked =)

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  33. Michelle
    Posted May 22, 2010 at 4:31 AM | Permalink | Reply

    Thank you! You really saved me. :)

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  34. Bryan
    Posted June 19, 2010 at 1:12 PM | Permalink | Reply

    Could you explain how to install ghostscript and ghostviewer? I can’t seem to get this to work. How do I know if they are even installed? Please help!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  35. Cameron
    Posted June 21, 2010 at 2:45 AM | Permalink | Reply

    Great tutorial, thanks for taking the time!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  36. Joy
    Posted August 7, 2010 at 6:07 PM | Permalink | Reply

    @ Cody: I’m seeing some error messages also since upgrading to 10.6.4. Here’s a bit from my system.log file:

    Aug 7 18:00:01 Joyful-MacMini php[10391]: PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so’ – dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so, 9): Library not loaded: /opt/local/lib/libMagickWand.3.dylib\n Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/magickwand.so\n Reason: image not found in Unknown on line 0

    I wonder if an OS update messed up the PHP extensions?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
    • Posted August 8, 2010 at 1:05 AM | Permalink | Reply

      You may have to rebuild the extension. Sometimes changes to the core PHP file can affect extensions build for it, as the version you could have built it for was 5.3.0 and the current version is now 5.3.1… or the file could be missing altogether. Check to make sure the file exists, and if not, rebuild it.

      My PHP version information:

      macbook (wireless):~ Xeon$ php -v
      PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22)
      Copyright (c) 1997-2009 The PHP Group
      Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
      with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans
      macbook (wireless):~ Xeon$

      My PHP extension installed:

      macbook (wireless):~ Xeon$ php -m
      [PHP Modules]
      bcmath
      bz2
      calendar
      Core
      ctype
      curl
      date
      dom
      ereg
      exif
      fileinfo
      filter
      ftp
      gd
      hash
      iconv
      imagick
      imap
      json
      ldap
      libxml
      magickwand
      mbstring
      mcrypt
      memcache
      mysql
      mysqli
      mysqlnd
      odbc
      openssl
      pcre
      PDO
      pdo_mysql
      pdo_sqlite
      Phar
      posix
      Reflection
      session
      shmop
      SimpleXML
      snmp
      soap
      sockets
      SPL
      SQLite
      sqlite3
      standard
      sysvmsg
      sysvsem
      sysvshm
      tokenizer
      xdebug
      xml
      xmlreader
      xmlrpc
      xmlwriter
      xsl
      zip
      zlib

      [Zend Modules]
      Xdebug

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: -1 (from 1 vote)
  37. Kev
    Posted May 3, 2011 at 1:04 PM | Permalink | Reply

    Don’t tell people to rm -rf /opt/local (!)

    Otherwise, helpful post, thanks : )

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 2 votes)
  38. Bhupendra Singh
    Posted May 22, 2011 at 8:26 AM | Permalink | Reply

    Recently migrated to Mac. A great help from you. Thank you dude.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 3 votes)
  39. Cody
    Posted July 21, 2011 at 5:13 PM | Permalink | Reply

    Incase anyone is wondering. This method works beautifully on Lion :D

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  40. TVNshack
    Posted September 13, 2011 at 4:18 PM | Permalink | Reply

    Hello ! Thanks a lot for this great detailed HowTo.

    I would add a few of my own experience here:

    You must get rid of the “quarantine” flag attached to each downloaded file. You must do that on the tarball before to unpack it otherwise all extracted files will be flagged!

    Type the following in terminal

    xattr -d com.apple.quarantine *gz

    Then it is preferable to change the ownership of the extracted files as most tarballs are created to maintain the uid:gid of the original files, which of course doesn’t correspond to anything in your system

    The best way to do this is to become root at first and do all the compilation work as root.

    Type in the following:

    sudo -s
    (password)

    chown -R root:admin (list of extracted packages)

    Additionally, on /etc/php.ini

    You can update the session.gc_maxlifetime to match phpMyAdmin default timeout

    session.gc_maxlifetime = 3800

    Last, you should change the pass to mysql.sock that is set to /tmp and not /var/mysql

    Check it so:

    ps -ef | grep socket

    You’ll see the mysqld process. Somewhere in the command line you’ll see where is the socket used by your MySQL instance –socket=/tmp/mysql.sock

    Cheers,
    Thierry

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  41. Posted September 24, 2014 at 3:16 AM | Permalink | Reply

    Pretty! This has been an incredibly wonderful article.
    Thanks for providing this info.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  42. Posted September 25, 2014 at 2:07 AM | Permalink | Reply

    Los Angeles County in California will offer a test refusal, many state laws
    and penalties you will stay on your area. Furthermore, you will be no more search engine and
    enter in” I’m not contesting the DUI. Should I bring
    an attorney who goes for trial ranges anywhere between one to three years.
    Having this criminal offense or mommy makeover a friend, a DUI.
    This is due to the fact that mommy makeover he had 3 different breathalizer tests.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  43. Posted September 25, 2014 at 2:08 AM | Permalink | Reply

    You ought to take part in a contest for one of the most useful sites on the internet.
    I’m going to recommend this web site!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  44. Posted September 25, 2014 at 9:15 AM | Permalink | Reply

    Looking for a best way to jailbreak your
    new bought iPad three? They don’t want to be linked with only on AT&T
    network. You can use tethered or untethered jailbreak techniques.
    Thin wallets are in demand for each men and ladies.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

12 Trackbacks

  1. By INSTALLER SNOW LEOPARD QUAND ON EST DÉVELOPPEUR on September 3, 2009 at 12:10 PM

    [...] plus de modules qu’avant, maintenant s’il vous manque des modules, vous pouvez vous inspirer de ce guide (en anglais) pour installer des modules supplémentaires à la version de PHP fournie par Apple. Je [...]

  2. [...] du tutoriel de Xeon Xai, après execution… of [...]

  3. By MAMP stacked (Mac OS X 10.6) « Gabriel de Kadt on November 15, 2009 at 7:03 PM

    [...] Go and see Xeon Xai’s blog post Snow Leopard PHP Extensions Installation Tutorial for how to add to mcrypt and other useful PHP extensions that Apple doesn’t include. The [...]

  4. [...] Installing PHP Extensions Imagick, Magickwand, Memcached, MCrypt [...]

  5. By The last weeks Tweets | clauswitt.com on February 1, 2010 at 2:13 AM

    [...] my development environment on my work Mac…. http://blog.xeonxai.com/2009/09/02/146/ This was easier in Ubuntu… [...]

  6. [...] For MacPorts users, there is a good tuts here. [...]

  7. By ehcache.net on January 8, 2011 at 11:10 AM

    Snow Leopard PHP Extensions Installation Tutorial…

    This will help you to setup imagick, magicwand, xdebug, mcrypt and memcached for Snow Leopard’s bundled PHP 5.3.0. Please do expect the installation of ImageMagick to take a bit of time, as it requires a large number of packages. I’m doing it all my pr…

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  8. [...] mcrypt für php aktivieren blog.xeonxai [...]

  9. By links for 2011-06-17 | Stéphane Thibault on June 18, 2011 at 12:04 AM

    [...] Snow Leopard PHP Extensions Installation Tutorial – Xeon Xai (tags: WebServer PHP Mac osx extension Installation Tutorial howto) Thibault, Stéphane (2011). “ links for 2011-06-17 ”, online, <http://xn--stphanethibault-cnb.com/2011/06/18/links-for-2011-06-17/&gt;, Stéphane Thibault, published on 2011-06-18, accessed on 2011-06-18, no comments. [...]

  10. [...] [...]

  11. [...] Snow Leopard PHP Extensions Installation Tutorial – Xeon Xai 9 Responses [...]

  12. […] Snow Leopard PHP Extensions Installation Tutorial – Xeon Xai 12 Responses […]

Post a Comment

Your email is never shared. Required fields are marked *

*
*