Here is a simple steps to install JSON for PHP in *nix server. The sample command below are running under Centos OS.

yum update "*php*"

Make sure you have install PHP Pear.
yum install php-pear

and The pecl command can then be found at /usr/bin/pecl

Then, we can start install PHP JSON.
pecl install json
cd /etc/php.d/
echo “” >> json.ini
service httpd restart

If you are using JQuery with JSON, take a look at this JQuery Json Library. Easy to use and simple.

ImageMagick PDF to Image conversion or Vice versa

Using Linux version of ImageMagick to convert PDF to Image

convert -density 140 test.pdf -resize 25% -quality 100 -colors 256 test.png

You can even use PHP ImageMagick library to convert pdf to image file.

For more information can be view from here :

Allow Apache PHP to access Unix Command or software.

Recently i was working with ImageMagick software (Open Source), basically a very powerful image suite to create, edit, and compose bitmap images. It can manipulate any sort of image just by using command line. Image using Photoshop with command line.

But calling an ImageMagick command using PHP Web pages required some configuration in the visudo files. Apparently, by default unix os will restrict any call or process that do not have any permission to access the internal command. If you wish to execute ImageMagick, you either required to use root user or user who is allowed externally to access the command. One of the way is to enable apache user, remove the Required TTY with visudo and add this to line into visudo (APACHE ALL = (ALL) NOPASSWD). I won’t say this is the only way, but this is one of the most easier. You can either use the PHP ImageMagick library or create and assign a group for apache that are only allowed it to access certain thing in the unix.

But the problem with using ImageMagick PHP library packages is that you can’t have much flexibility and control compare of using the command line.


1. Open up your sudo configuration using visudo command.
2. Find the line Required TTY and comment it out using #Required TTY
3. Add another line that remove required password when apache trying to use the command. : APACHE ALL = (ALL) NOPASSWD
4. Restart your apache and you are done with service httpd restart. Check your apache error log if you still can’t run the command to access ImageMagick.

Here are the list of ImageMagick PHP Packages :
MagickWand for PHP (PHP)
IMagick (PHP)

Google VS PHP

Here is the recent article Google published for Web optimisation technique for PHP. It got bad PHP community slap back especially from the and Google group forum. It is quiet interesting to see how beginner PHP will actually fall in the trap which recomemded so of the tips from the articles.

My Favourite Web Development tools.

Every few months, i will be Googling or check out new web development tools for my work and personal projects. Unbelievably,  new cool and fantastic tools kept popping up, something you even have problem which best tool to used. The tools i meant here, are tools like IDEs, plug-in, library, framework, CMS, test-suite and more. Below, are the list of tools that currently i am using and found it very useful and increasing my productivity. All the tools are OPEN  SOURCE which i am a very big fan of.

Firefox Add-ons


1.  Again, Firebug win my heart. This tool let you inspect and edit CSS on the fly. Not only css, debugging javascript with it, save tons of your time to look for javascript errors.

Firebug screen shot

Firebug screen shot

2. iOpus iMacros – from a Firefox add-ons : to record form filling and replay the task you had been recorded. Save your time kept repeating testing for web forms, useful for web testing, web scraping and more.



3. Web development– from a Firefox add-ons : Great tools with lots of functionality for web developers. Such as markup validation,  cookies management, http header management and more.

Web Development toolbar (Firefox add-ons)

Web Development toolbar (Firefox add-ons

4. XDebug for Javascript

5. Yahoo YSLOW – Javascript profiler : A great tools to check how to faster up your website. Their also provide best practice and guideline how to improve and tune website loading performances.



1. Zend framework : started using recently and fall in love with it. Strong MVC architecture support and database adapter.

2. jQuery : A Cool Javascript framework that i have been using almost 2 years since it released. JQuery have strong community support, easy to learn, good documentation (at least better than some), more books on JQuery and more.



1. 960 Grid System from MIT. Very easy to use and faster up your layout  design for a new website without worrying if the new row or column will expand accordingly.



1. Although this part is a bit not relevant, but i insist to introduce the best question and answer programming/IT forum :

2. Slashdot : Ah!!..sometimes you need a break from your IDE or notepad.

Time Tracker


1. I use RTM : Remember the Milk task list which integrate well with Gmail Task List.

2. Google Calendar : Use it for weekly planner and task remimder which sent free sms reminder to your mobile phone.