• 3 min read
  • I play around with a number of Drupal locally and today I finally caved in and decided to add GD support to OS X's webserver. Although I've heard great things about the Entropy PHP packages, I did not want to replace OS X's integrated php installation so my remaining option was to grab a copy of PHP 5.2.8 (the version bundled with Leopard) and compile the module myself. I know there must be quite a few other people who are looking do to the same thing, so I here's a step-by-step guide on how I did it:

    (Please note that I assume you have Xcode installed, and that all downloads are saved in the "Downloads" folder in your home. If this is not the case, please move the downloads there first before executing any of the listed commands)

    1. Visit the libpng and libjpeg homepages and download the latest release available for both. As of writing, the most recent releases are libjpeg 7 and libpng 1.2.37 - the commands below will need to be adjusted slightly if you are compiling a more recent version.
    2. Download PHP 5.2.8, available here
    3. Extract PHP and prepare to compile libpng and libjpeg statically:
      cd ~/Downloads
      tar xfj php-5.2.8.tar.bz2
      cd php-5.2.8/ext/gd
      mv ~/Downloads/libpng-1.2.37.tar.gz ~/Downloads/jpegsrc.v7.tar.gz .
    4. Compile libpng without shared libraries:
      tar xfz libpng-1.2.37.tar.gz && cd libpng-1.2.37
      ./configure --disable-shared --enable-static
      make && make install DESTDIR=`pwd`/localinstall
      cd ../
    5. Compile libjpeg without shared libraries:
      tar xfz jpegsrc.v7.tar.gz && cd jpeg-7
      cp /usr/share/libtool/config.* .
      ./configure --disable-shared --enable-static
      make && make install DESTDIR=`pwd`/localinstall
      cd ../
    6. Compile the GD extension and point to our newly compiled libpng and libjpeg static libraries:
      cd ~/Downloads/php-5.2.8/ext/gd
      phpize
      MACOSX_DEPLOYMENT_TARGET=10.5 \
      CFLAGS="-O3 -fno-common -arch i686" \
      LDFLAGS="-O3 -arch i686" \
      CXXFLAGS="-O3 -fno-common -arch i686" \
      ./configure --with-zlib-dir=/usr \
      --with-png-dir=`pwd`/libpng-1.2.37/localinstall/usr/local \
      --with-jpeg-dir=`pwd`/jpeg-7/localinstall/usr/local \
      --with-freetype-dir=/usr/X11R6 \
      --with-xpm-dir=/usr/X11R6
      make
      sudo make install
    7. Copy /private/etc/php.ini.default to /private/etc/php.ini
      • Change the default 'extension_dir' (./) to /usr/lib/php/extensions/no-debug-non-zts-20060613/
      • Add extension=gd.so a bit below extension_dir to enable the gd extension
    8. sudo nano /System/Library/LaunchDaemons/org.apache.httpd.plist
      Change the part betweenandso that it looks like this:


      /usr/bin/arch
      -i386
             /usr/sbin/httpd
             -D
             FOREGROUND

      This will ensure that Apache starts in 32 bit mode, which is needed as the gd extension was compiled for i686.

    9. That's all! After a reboot (or toggle Web sharing in the System Preferences), everything should be working. phpinfo() should now confirm that GD library is indeed loaded. If it isn't or if apache refuses to start, try opening Console to check /var/log/apache2/error_log for some useful pointers as to what's wrong.

      Helpful source I used for writing this tutorial: HOWTO: Install Habari on Mac OS X Leopard, From Scratch

  • 1 min read
  • I've always been hesitant to enable comments on my posts due to spambot activity, but I'm hoping Drupal is a bit better than Joomla at fending spammers off... I'm going to enable (moderated) comments for a week and see how it goes. Feel free to leave a comment on any of my articles!

  • 3 min read
  • A friend of mine recently bought a MobileMe subscription and I was pretty curious about what it would offer as I've seen the demos from Apple's WWDC keynote. After experimenting with it for a bit while I was setting it up on my friend's home computers, I found that it is actually a very worthwhile purchase for for both home and small business users. The one downside to it was that Apple does not allow the use a non- @me.com email address. Luckily, after about an hour of playing I was able to setup a system which enabled Thunderbird and other email clients to use the MobileMe email features with non- @me.com email address.

    The problem is Apple's outgoing mail (SMTP) servers, which reset the From: header in all messages. No matter how you configure your client, all outgoing mail shows From: myuser@me.com. By avoiding the Apple's SMTP servers, you can bypass this problem and send mail as if it was sent from your previous address (for example yourname@yourdomain.com). Here are the steps required to set it up:

    1. Forward all incoming mail to your MobileMe address

      CPanel and many other hosting control panels will support forwarding all mail from one address to another. In CPanel, click on "Mail Forwarders" and forward all mail from your previous address to youruser@mobileme.com. If your hosting provides a different control panel and you can't find the mail forwarders option, try contacting your hosting's technical support team for more information.

    2. Configure your email client (incoming mail)

      In order to receive new messages, you will need to create a new IMAP account. Email clients such as Outlook, Outlook Express, Thunderbird, Entourage and Apple Mail all support IMAP. Apple has a step-by-step guide for setting up each of the programs listed above. If you are using another program, you'll need to enter the following settings manually:

      • Account type: IMAP
      • Incoming server: mail.me.com
      • Incoming username: Your MobileMe account name (the part before "@me.com")
    3. Configure your email client (outgoing mail)

      Instead of entering the outgoing (SMTP) details as listed on the Apple tutorial, enter the information for your hosting that you previously used instead. For example, your outgoing server may be mail.yourdomain.com or smtp.yourdomain.com.

    4. (Optional) Create identities

      If you are forwarding many custom email addresses to your MobileMe account, you may want to take the time to use the Identity feature of your mail client so that you can reply mail as if writing form any of the many custom emails instead of just one (different clients may offer the same feature but under a different name). In Thunderbird, you can manage your Identities by selecting Tools > Account Settings... > Manage Identities

    The only trouble you may encounter with this method is that sending mail from the MobileMe Web interface will still show @me.com, as the webmail passes through Apple's SMTP servers.

    Note: This procedure works for iPods too! If you configure your iPod's incoming and outgoing mail as shown above, you should also be able to send mail from your custom address as well.

  • 3 min read
  • Requirements

    What is the difference between the proprietary and open source nVidia drivers?

    The main difference between open source drivers and closed (proprietary) drivers is performance. The proprietary nVidia driver has much better 3D performance than the current driver for nVidia cards packaged with Fedora, called nouveau. However, keep in mind that nouveau is completely open and free, while the nVidia's proprietary driver is closed source. This means that sometimes a bug in the driver can't be fixed or an incompatibility cannot be resolved until nVidia decides to release an updated proprietary driver.

    Driver series

    Identifying your card model

    If you are unsure about which graphics card is installed in your computer, open a terminal and type:

    /sbin/lspci | grep VGA

    Your card model should be printed on the screen.

    Installing the most recent driver

    Please note that any card below and including the GeForce FX series is no longer supported by the mainstream nvidia drivers. If you own a 5xxx series card or lower, please continue reading the next sections. If you own a 6xxx series card or higher, install the xorg-x11-drv-nvidia package.

    173xx series legacy driver

    The 173xx driver is for GeForce "FX" or GeForce 5200 users. Install the xorg-x11-drv-nvidia-173xx package.

    96xx series legacy driver

    The 96xx driver is for GeForce 2 through 4 users, including the GeForce 4 MX. Install the xorg-x11-drv-nvidia-96xx package.

    71xx series legacy driver

    Users of Riva or TNT cards must install the xorg-x11-drv-nvidia-legacy package.

    A note for x86_64 (64-bit) users

    If you installed the x86_64 version of Fedora, you may wish to install an additional package which will enable 3D rendering in 32-bit application you run. To do so, simply install the xorg-x11-drv-nvidia-libs.i386 package. If you have a legacy card, you will need to adjust the package name to reflect the legacy series installed. For example, 96xx users must install xorg-x11-drv-nvidia-libs-96xx.i386.

    Reboot & test

    The last step for driver installation is to regenerate the initrd image and reboot. Similar to fglrx and radeon, the nouveau and nvidia kernel modules are incompatible. Because in Fedora 11 nouveau had been made the default and like radeon, is present in the initrd image, it must be removed before the nvidia driver will work correctly. Here's how:

    su -
    mv /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r)-nouveau.img
    mkinitrd /boot/initrd-$(uname -r).img $(uname -r)

    If the commands above ran successfully, restart your system. You can test if the driver is configured correctly correctly by opening a terminal and typing:

    glxgears

    If the animation is smooth, then the drivers were successfully installed.

    Further reading and troubleshooting tips

    For more information and troubleshooting tips, visit the xorg-x11-drv-nvidia page on the RPM Fusion wiki.

  • 2 min read
  • Requirements

    I want them all!

    If you want to install all of the items listed in this howto, install the following items:

    • DVD playback packages: libdvdcss, libdvdread and libdvdnav
    • MPEG plugins: gstreamer-plugins-bad and gstreamer-plugins-ugly
    • Java: java-1.6.0-openjdk and java-1.6.0-openjdk-plugin
    • Adobe Flash plugins:
      su -
      rpm -Uhv http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
      yum install flash-plugin nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386 alsa-plugins-pulseaudio.i386 libcurl.i386
      mozilla-plugin-config -i -g -v
      

    DVD playback

    You will need to install the following packages:

    • DVD playback packages: libdvdcss, libdvdread and libdvdnav
    • MPEG plugins: gstreamer-plugins-bad and gstreamer-plugins-ugly

    MP3 playback

    To enable MP3 playback, all you need to do is to install the MPEG plugins: gstreamer-plugins-bad and gstreamer-plugins-ugly.

    Java (JRE) and the Java web plugin

    Install java-1.6.0-openjdk and java-1.6.0-openjdk-plugin.

    Adobe Flash player

    Installing Flash is a bit more complicated than installing other packages:

    1. Open a terminal
    2. Type:
      su -
      rpm -Uhv http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
      yum install flash-plugin nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386 alsa-plugins-pulseaudio.i386 libcurl.i386
      mozilla-plugin-config -i -g -v
      
    3. You can now close the terminal window

    Additional media players

    After installing the media codecs and plugins, you may wish to install additional media players. Here are a list of some popular media players available from Fedora and RPM Fusion:

    • vlc
    • totem-xine
    • mplayer

    Need more help or want to ask a question? Discuss this topic here.