Installing PHP-Mcrypt on CentOS 6

I needed to install php-mcrypt on my VPS because of an application and well, below is how i did it.

Download package – Install using yum – Restart Apache

[root@s16960602 ~]# rpm -ivh
warning: /var/tmp/rpm-tmp.Qzis3Y: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing…                ########################################### [100%]
1:epel-release           ########################################### [100%]
[root@s16960602 ~]#
[root@s16960602 ~]#
[root@s16960602 ~]# yum install php-mcrypt
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
epel/metalink                                                                                         |  11 kB     00:00
* epel:
base                                                                                                  | 3.7 kB     00:00
epel                                                                                                  | 4.2 kB     00:00
epel/primary_db                                                                                       | 5.3 MB     00:01
extras                                                                                                | 3.5 kB     00:00
updates                                                                                               | 3.4 kB     00:00
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
–> Running transaction check
—> Package php-mcrypt.x86_64 0:5.3.3-1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

Package                        Arch                       Version                            Repository                Size
php-mcrypt                     x86_64                     5.3.3-1.el6                        epel                      18 k

Transaction Summary
Install       1 Package(s)

Total download size: 18 k
Installed size: 46 k
Is this ok [y/N]: y
Downloading Packages:
php-mcrypt-5.3.3-1.el6.x86_64.rpm                                                                     |  18 kB     00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <>
Package: epel-release-6-8.noarch (installed)
From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : php-mcrypt-5.3.3-1.el6.x86_64                                                                             1/1
Verifying  : php-mcrypt-5.3.3-1.el6.x86_64                                                                             1/1

php-mcrypt.x86_64 0:5.3.3-1.el6

[root@s16960602 ~]# service httpd restart
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]

A Really Great Beard, the Secret of a Successful Programming Language

Why do some programming languages take over the world while others wallow in obscurity?

Two academics at Princeton and the University of California, Berkeley are combing through mountains of data trying to tackle this mystery of the modern world. They think the answer may lie with how well a language is documented. Or with the reality that the average programmer doesn’t have the time or the inclination to learn more than a handful of programming tools. Or even with the age-old tendency of academics to build stuff that’s gloriously clever but completely impractical.

But a man named Tamir Kahson has a different answer. He thinks it’s all about the beard.
Continue reading “A Really Great Beard, the Secret of a Successful Programming Language”

3-Tier Architecture vs MVC Software Architecture

N-Tier Architecture

3-Tier software architecture is client-server model where the presentation, the application processing, and the data management are logically separate processes. On web technologies, for example we have the Client (Presentation), Web server (Logical), and Database (Data Management) as the 3-tier. 2 -tier typically involves an architecture without data management where only the presentation and the logic is used.

Presentation tier:This is the topmost level of the application. The presentation tier displays information to and fro the Application Logic. It communicates with other tiers by outputting results to the browser/client tier and all other tiers in the network.

Application tier: (business logic, logic tier, data access tier, or middle tier). The logic tier is pulled out from the presentation tier and, as its own layer, it controls an application’s functionality by performing detailed processing.

Data tier: : This tier consists of database servers. Here information is stored and retrieved. This tier keeps data neutral and independent from application servers or business logic. Giving data its own tier also improves scalability and performance.

Model View Controller (MVC)

Model-View-Controller (MVC) is a software design pattern or software architecture that separates application logic from from input and presentation (UI), permitting independent development, testing and maintenance of each.

How are these architecture different Continue reading “3-Tier Architecture vs MVC Software Architecture”

Dynamic HTML Drop down Menu using PHP

Many of us are familiar with the HTML drop down menu which allows us select a choice within a list of options. A typical example for Male and Female is written as

<select name=”select”>

<option value=”m”>Male</option>

<option value=”f”>Female</option>


However, using this input during Form filling poses no threat until when you (as a developer) want to call/retrieve the users profile from the database with the chosen option in the List Menu. Well this is one thing HTML will sure not help you with. Server side scripting does a lot of its “magic” between the Browser, Web Server and Database. Using PHP, I have seen in some blogs and site where the HTML List Menu was tweaked to generate the desired result like;


$sql=mysql_query(“select gender from profile where user=’$_POST[‘user’]’”);


echo “<select name=\”select\”>”;

If (isset($row[‘user’]))    {


Continue reading “Dynamic HTML Drop down Menu using PHP”

PHP Insert Function

Learning PHP as a scripting language is fun but gets a little interesting when you have your own PHP-Function Library. Today, Many frameworks exist to help us with a lot of things but what about you doing your own magic. In 2007, I got tired of writing long insert statements into tables and i wrote the function below for a straight insertion with one line.

More information on PHP functions can be gotten from php website.

Download the insert function files here

Things to Note on the script:

1. The html input names e.g. textbox, textarea must have the same name as the table fields name

2. The system works with both POST and GET method, however, the preferred method should be edited on line 20 of the insert_all() function.

3. Call the Script with only the Table Name. Fields without POST/GET values will not be inserted.

Using the SCRIPT: Continue reading “PHP Insert Function”