Monthly Archives: August 2009

installing APC & uploadprogress on CentOS 5 [updated]

First, we need the pecl command so we can download and install APC from the repositories. I use the “remi” repo to give me the latest packages, so use “–enablerepo=remi” if you have it installed.

yum install php-pear
But, this will not run on its own, we need the following package for the phpize command:

yum install php-devel
We also need the apxs command, which is installed via the following package:

yum install httpd-devel
Now we have all the software we need, so we install apc via the pecl command:

pecl install apc

I also recommend installing uploadprogress, because Drupal 6 will ask you to do so.

pecl install uploadprogress

Now we have to enable apc and uploadprogress in php.ini.

Add the following lines to /etc/php.ini or wherever your php config file is located.

Then we restart Apache:

/etc/init.d/httpd start
And we are all done. Watch for less execution time per page, and decreased memory usage per Apache process compared to what you had

GMAIL and Apple Mail singing together… amazing

Maybe someone out there already found this… but Gmail and are singing together quite nicely.

Today I was replying to an email from Mail and noticed something very interesting…

Mail syncs your reply with Gmail as you type.
Mail syncs your reply with Gmail as you type.

Then when you keep typing more… you will see the little box on the bottom saying your conversation in Gmail has been updated… Clicking on update will bring in the rest of the things you typed in another thread.

Gmail and Mail

After the reply is sent, all the temporary threads in Gmail will be deleted and you will be left with one single reply message.

UberCart Drupal Theme [updated]

Update: It’s no news that TopNotchThemes has released an awesome free theme for Ubercart called Acquia Prosper.

this theme is built on the Fusion Core base theme and the Skinr module.

I currently have a few clients requesting Ubercart on their Drupal site. I will be taking a close look at Acquia Prosper soon, so stay tuned for a review and tutorials.

include PHP inside custom Drupal modules


In an attempt to make my sites more dynamic and easier to manage, I use PHP includes quite extensively. I like the idea of make a change in a single file and have it propagated to other sections of the site that call upon it.

However, when you want to have multiple custom modules in Drupal to include PHP… it gets tricky. Depending on how your modules are written, it is usually not within the same scope as the Drupal core… therefore your variables should be global if you want to call them throughout the site.


include_once() and  require_once() do not work so well in these situations.

I’ll give you an example. I have written a very large and complex custom theme for a client with ecommerce needs. I’m including a file called that defines a bunch of variables for my ecommerce module. This file has been included in numerous modules with include_once().

I’m also using a module called node_content themehook to theme only on a node level.

When I try to include in my node_content templates using the *_once() functions… Drupal thinks the file has been included once even when it has not. This problem is not specific to the node_content module. When you have multiple modules calling the same file… using *_once() is not reliable at all.

The solution…? simple as hell.  Use include() and  require().

New projects…

busy busy busy…

Got another Drupal project booked… this time I’ll be using UberCart instead of OsCommerce. UberCart is a native Drupal module that offers comprehensive e-commerce features to the platform. UberCart does require some effort to configure and it really doesn’t work straight out of the box (unlike OsCommerce) but it takes full advantage of all the common Drupal goodies – CCK, View, taxonomy… Check back for more updates, and I’ll be posting my codes as the project moves on.

Previous employer (Alternatives Journal) is teaming up with Magazine Canada and to offer digital magazines. This will probably make my custom OsCommerce platform obsolete… but it’ll be interesting to learn how Zinio operates. Zinio is giving these magazines a very sweet deal and I was surprised to learn that most of their services are free (for the duration of the contract – 2 years).

I got the feel that they are trying to suck in as many clients as possible by offering free incentives to publishers and customers. However, a glance at their UI left me with much to desire. I didn’t see any innovative features at all… at the end it just felt like another Flashpaper viewer with embedded PDFs. When compared to more polished services like,  Zinio has some work to do.

I still haven’t seen any paperwork from Zinio, but the challenge will be to mesh our existing e-commerce effort with their system. Customer databases need to be synced… financial reports need to be combined and analyzed…. all the fun stuff.  Expect more updates.

Take a look at the site I built for Alternatives Journal – (Drupal site)