Thursday, August 8, 2013

Install php

PHP Modules

PHP also has a variety of useful libraries and modules that you can add onto your server. You can see the libraries that are available by typing:
yum search php-

Terminal then will display the list of possible modules. The beginning looks like this:
php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Human Language and Character Encoding Support
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php-imap.x86_64 : A module for PHP applications that use IMAP
To see more details about what each module does, type the following command into terminal, replacing the name of the module with whatever library you want to learn about.
yum info name of the module

Once you decide to install the module, type:

sudo yum install name of the module

rpm –qa | grep –i php
rpm -q php :view version php
The previous command queries the package database to see if any packages with php in the title are installed on the system. After invoking the command, you should see output similar to the following: [root@server ~]# rpm -qa | grep -i php php-domxml-4.3.9-3.9 php-odbc-4.3.9-3.9 php-4.3.9-3.9 php-mysql-4.3.9-3.9 php-pear-4.3.9-3.9 php-pgsql-4.3.9-3.9 php-imap-4.3.9-3.9 [root@server ~]# The output shows that php-4.3.9-3.9 and php-mysql-4.3.9-3.9 are installed. You can also confirm that MySQL is installed by using the following: rpm –qa | grep –I mysql Similar output should follow: [root@server ~]# rpm -qa | grep -i mysql mysql-4.1.12-3.RHEL4.1 mysql-server-4.1.12-3.RHEL4.1 perl-DBD-MySQL-2.9004-3.1 php-mysql-4.3.9-3.9 mod_auth_mysql-2.6.1-2.2 [root@server ~]# To verify that httpd (apache web server) is installed, use the following: [root@server ~]# rpm -qa | grep -i httpd httpd-2.0.52-19.ent.centos4 httpd-suexec-2.0.52-19.ent.centos4 [root@server ~]#