Mac OS X Lion Upgrade PHP Extensions Tutorial: ImageMagick and More.

By Xeon Xai  

After upgrading my Mac OS X Snow Leopard to Mac OS X Lion, I noticed that some of my PHP extensions that I had compiled to work with the Apple PHP 5.3.6 binary had been removed. Some, not all. Which I assume is due to them having been compiled 4-way binary compatible (PowerPC and i386/x86_64). Since Lion no longer supports PowerPC, it seems that all the extension files that had PowerPC in them were removed. Xdebug was still there, but all the rest were gone. Below is the process I performed to get everything back.

Step 1:
Download and install MacPorts 2.0.0 for Mac OS X Lion.

Step 2:
In Terminal, run the following commands. The first one may take a while to update the binaries as it compiles them.

sudo port upgrade outdated
sudo port uninstall inactive

Step 3:
Download and install MySQL 5 (currently at mysql-5.5.15-osx10.6-x86_64 as of this writing) for Mac OS X.

You may not need to install MySQL, though I chose to do so as I wanted to update to the 64bit System Preferences panel, since I was running an earlier version of MySQL 5 previously.

Step 4:
I also noticed that my /etc/php.ini file was moved to /etc.php.applesaved and no longer called any of my PHP extensions I had set.

In Terminal, run the following:

sudo cp /etc/php.ini.applesaved /etc/php.ini
sudo apachectl graceful

Step 5:
Continue on to my PHP extensions tutorial for Snow Leopard and begin with Step 5 if you don’t have ImageMagick installed, Step 6 if you do.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

9 Comments

  1. Tom Bajzek
    Posted September 7, 2011 at 9:35 PM | Permalink | Reply

    I’m running on a new MacMini Server, which has started out with Lion. I followed your instructions for imagick, and it appears to have installed successfully. However, when I try to use imagick, it fails, with “PHP Fatal error: Class ‘Imagick’ not found.” If I run phpinfo(), I do not see an indication that imagick is available, even though I’ve put imagick.so into /usr/lib/php/extensions/no-debug-non-zts-20090626 as required.

    Can you suggest what I should look for to try to resolve this?

    Thanks,
    Tom

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Posted September 7, 2011 at 9:38 PM | Permalink | Reply

      Have you added the imagick.so file with path to the php.ini file? That is required to load it.

      You can run “php -m” from the command line to see what modules are loaded.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Tom Bajzek
        Posted September 7, 2011 at 9:45 PM | Permalink | Reply

        Thanks for the quick response. php -m indicates that imagick has not been loaded. I’ve put the imagick.so file into the directory where the extensions are supposed to be.

        Are you saying that the extension=php5-imagick.so
        directive needs to have the path included as well?

        Thanks,
        Tom

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Posted September 7, 2011 at 9:54 PM | Permalink | Reply

          The should have the full path to the file.

          /usr/lib/php/extensions/ and so on to the file, and ending with the file.

          As it has to know where it’s located or it won’t find it.

          VN:F [1.9.22_1171]
          Rating: 0.0/5 (0 votes cast)
          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
  2. Tom Bajzek
    Posted September 7, 2011 at 10:23 PM | Permalink | Reply

    I did insert the path into php.ini:

    extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/php5_imagick.so

    The same error persists. I’m about finished for tonight.

    Next, I’m going to look at the ini_set(‘include_path’, ‘/usr/lib/pear’); possibility with the right item instead of ‘pear’

    Thanks for your suggestions I feel that I’m getting closer.

    Tom

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Posted September 8, 2011 at 2:12 PM | Permalink | Reply

      I would suggest leaving it as the imagick.so file name, as it is by default, at least when I compile it. I also compile MagickWand extension as well, so that I have both.

      Also, always be sure that when adding a php extension, that you remember that “sudo apachectl graceful” is required for Apache to see any new PHP extensions added to the php.ini file, but not required for command line (CLI) PHP.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  3. Rajat Kamraj
    Posted April 1, 2013 at 8:42 PM | Permalink | Reply

    Hi,

    I came across your blog and understand that you have worked on ImageMagik before. I am particularly looking for some tech expert to figure out the technology behind this http://www.shoesofprey.com/3d/designer?p=JFP1&d=singlebow

    Are these being rendered on the fly or have they stored 3.8×10^22 images ?

    Thanks,
    Appreciate your help on this.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Posted April 1, 2013 at 9:32 PM | Permalink | Reply

      This could certainly be done with base background images and overlay the different colors and textures over it in the selected positions, using transparent PNG panels for each customizable part. Most certainly they are doing it on the fly and then saving the images as needed. As it is always refreshing. During the refresh it could generate any image not yet made.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  4. Posted September 11, 2013 at 4:06 AM | Permalink | Reply

    Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how
    to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there!
    Thank you

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

Post a Reply to las vegas bottle package

Your email is never shared. Required fields are marked *

*
*