How to install php module file in linux


One day, I have to install one module file in my linux server so  I have googling for it and here I want to share. I hope its helpful for others.

I want to install mcrypt extension in linux server.

First we need to download rpm file and then we need to install……

Step 1:-

wget – this command is used to download rpm file from another server directly from live link,  if you have not uploaded in your server.

For example,

wget http://www.domain.com/foldername/<extensionname.rpm&gt;

Step 2:-

rpm – This command is used to build, install, query, verify, update, and erase individual software packages.

For example,

rpm <extensionname.rpm>

help link :- http://linux.about.com/od/commands/l/blcmdl8_rpm.htm

Above command will be install rpm file in server.

Step 3:-

yum search – > This command is used to get list of installed/upgrade module list

yum list php* -> This command will  give us to installed  php’s module list.

yum  info <softwarename> – > Give us to detail of software.

yum install <softwarename> -> If the result displays that the software is available, and you are happy with the version.

If the software is not available, you will have to find the RPM and copy it to your server. You can use scp to copy the file. Then, use RPM on your server to install the package.

[root]# cd dirWhereRPMResides
[root]# rpm -i MyRPMName

For more details on yum and rpm, see the man pages.

[root]# man rpm

[root]# man yum

And finally we need to restart our server using below command.

httpd -k restart

————-
Get a list of installed extension in server

[user@server ~]$ yum list installed | grep php | cut -d’ ‘ -f1
Result :-
php-mysql.x86_64
php-mcrypt.x86_64
php-pdo.x86_64
————-

login into another user account
su root
password :

first we need to get rpm file from another server
wget -c ftp://rmfind.net/linux/epel/<filename>.rpm

get list of installed extension
yum list installed | grep php | cut -d’ ‘ -f1
yum list installed | grep php

install extension
yum install <iphp-mcrypt-5.0.rpm>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s