How to Increase PHP File Upload Size Limit

Q. When you try to update the blog post in WordPress or any php application, you might notice that the application such as WordPress has a prohibitive maximum PHP file upload size. How to increase this limit in PHP ? In the below screenshot, i configured my PHP upload size to 50MB.

PHP file upload

A. If you own the virtual private server of dedicated web server, it is very easy to increase this parameter or option. The options can be set in php.ini configuration file, this configuration apply to all your applications. Many shared hosting server allows a maximum PHP file upload size is very low. This method may not work for most shared hosting because you do not give root access. If you plan to receive larger files, you should consider to purchase virtual private server (VPS) or dedicated server hardware.

What is default PHP File Upload Size (upload_max_filesize)?

The default values for PHP will restrict you to a maximum 2 MB upload file size.

Note : Below require you to access the server using root access from the linux server console. The steps has been tested on PHP 5.3 and PHP 5.4.

a) Login to your server via ssh connection.

b) Open php.ini file using vi editor :

# vi /etc/php.ini

There are two PHP configuration options that control the maximum PHP file upload size which are “upload_max_filesize” and “post_max_size”.

By default post_max_size = 8M and upload_max_filesize = 2M. You can update this value to the following :

c) Update this value from 8M to 60M :

post_max_size = 60M

d) Update this value from 2M to 50M :

upload_max_filesize = 50M

Note : Technically, post_max_size should always be greater than upload_max_file size . But for such a large number 150M you can safely make them the same size.

e) After you have made a changes, Then restart your web server to take effect of new PHP file upload size (e.g Apache or Nginx).

You can read more on these posts which explains PHP file upload article.

How to Install IonCube Loader in CentOS 6 / CentOS 7

ioncube loader

What is IonCube Loader ?

IonCube Loader is a PHP module or extension for PHP files decoding encrypted and is often required for many applications based on PHP. It helps us to protect php applications from unauthorized execution and at the same time can accelerate the website. This article will show you how you can install ioncube loader on CentOS 6 and the steps also works on CentOS 7.

1. Check and verify ioncube version :

# php -v
PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Your PHP version must match ioncube version :
eg. PHP 5.5 will use file: ioncube_loader_lin_5.5.so
eg. PHP 5.4 will use file: ioncube_loader_lin_5.4.so
eg. PHP 5.3 will use file: ioncube_loader_lin_5.3.so

In this case, php version is PHP 5.4, and the matching ioncube loader version should be ioncube_loader_lin_5.4.so.

2. Create directory for ioncube :

# mkdir /usr/local/ioncube

3. Download and extract the ioncube:

# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
# tar xzvf ioncube_loaders_lin_x86-64.tar.gz

4. Open the extracted ioncube folder and copy the ioncube loader file match to your php version. :

# cd ioncube
# cp -p ioncube_loader_lin_5.4.so /usr/local/ioncube

5. Now locate php.ini file. This is how you can find location of php.ini.

# php -i| grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

6. Edit php.ini file and save :

# vim /etc/php.ini

Add the following at the bottom of php.ini :

..
..
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.4.so

7. Verify the php version, it is now should include file “ioncube_loader_lin_5.4.so” in PHP 5.4 if you get the display as below :

# php -v
PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.

If you can see the version of PHP with ionCube loader version, meaning you have successfully installed and configured ioncube PHP loader in your linux system.

How to Hide PHP Version in Linux

In general, most of the web server software has been installed with default settings that will lead to information leakage. One of them is a PHP software. PHP (Hypertest Preprocessor) is one of the most popular server-side HTML embedded scripting language for the websites today. In the current challenging times, there are lots of attacker will try to discover the weaknesses in your your server system. Hence, i will describe the simple way to hide the PHP information in Linux server.

By default expose_php is set to On. Turning off the “expose_php” parameter causes that PHP will hide it version details.

[root@centos66 ~]# vi /etc/php.ini

In your php.ini, locate the line containing expose_php On and set it to Off:

expose_php = Off

Before the changes, web server header will look like below :

[root@centos66 ~]# curl -I https://webhostinggeeks.com/howto/
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.3
X-Pingback: https://webhostinggeeks.com/howto/xmlrpc.php
Date: Wed, 11 Feb 2015 14:10:43 GMT
X-Page-Speed: 1.9.32.2-4321
Cache-Control: max-age=0, no-cache

After the changes, PHP will no longer show the version to the web server header :

[root@centos66 ~]# curl -I https://webhostinggeeks.com/howto/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Feb 2015 15:38:14 GMT
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
X-Pingback: https://webhostinggeeks.com/howto/xmlrpc.php
Date: Wed, 11 Feb 2015 14:10:43 GMT
X-Page-Speed: 1.9.32.2-4321
Cache-Control: max-age=0, no-cache

How to Setup Nginx,PHP5.4, PHP-FPM, MySQL 5.5 On CentOS 6.5 VPS

This post will show you the procedure to setup Nginx, PHP5.4, PHP-FPM and MySQL 5.5 On CentOS 6.5 Virtual private server(VPS). You need to setup the required repo such as EPEL, Remi and also the NGINX repo.

What is NGINX ?

NGINX is an alternate web server for Apache. Nginx is an open source web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols. Many websites and the web developer have moved to NGINX because it’s scalable, low resources, can handle many users concurrency and good website performance. Now it still third most popular web server in the world and it serve just over 14% of all hostnames.

What is PHP(PHP-FPM) ?

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

What is MySQL ?

MySQL Database server is one of the most popular used database in the internet especially for content management and blogging site.

Steps to setup Nginx,PHP5.4, PHP-FPM, MySQL 5.5 On CentOS 6.5 VPS

1. Setup EPEL and Remi repository.
How to prepared EPEL and how to configure Remi repository in to CentOS.

2. Install php 5.4, php-fpm and MySQL 5.5 Server :

[root@vps-08 ~]# yum --enablerepo=remi install php php-mysql php-fpm mysql mysql-server -y

3. Setup repository for nginx :

[root@vps-08 ~]# vi /etc/yum.repos.d/nginx.repo

Add the following and save :

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

4. Install and setup NGINX :
Run the following command to install NGINX.

[root@vps-08 ~]# yum install nginx -y

a. Setup NGINX config file :

[root@vps-08 ~]# vi /etc/nginx/nginx.conf

Add the following and save:

user  nginx;
worker_processes  2;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    gzip  on;
    gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;

    include /etc/nginx/sites-available/*.conf;

}

b. Create sites-available directory and create nginx virtual host for example.com domain :

[root@vps-08 ~]# mkdir /etc/nginx/sites-available
[root@vps-08 ~]# vi /etc/nginx/sites-available/example.com.conf

Add the following and save :

server {
listen       80;
    server_name example.com;
    rewrite ^/(.*)$ http://www.example.com/$1 permanent;
}

server {
        server_name www.example.com;
        root /var/www/html/example;
        access_log /var/log/nginx/example.com.access.log;
        error_log /var/log/nginx/example.com.error.log;
        include conf.d/common.conf;
        include conf.d/wordpress.conf;
        include conf.d/w3tc.conf;
}

c. Create these three configuration files. It was optimized for WordPress site.

/etc/nginx/conf.d/common.conf
/etc/nginx/conf.d/wordpress.conf
/etc/nginx/conf.d/w3tc.conf

Create common.conf :

[root@vps-08 ~]# vi /etc/nginx/conf.d/common.conf

Add the following and save.

# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
# ESSENTIAL : Default file to serve. If the first file isn't found,
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
    log_not_found off;
    access_log off;
}
# ESSENTIAL : robots.txt
location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}
# ESSENTIAL : Configure 404 Pages
error_page 404 /404.html;
# ESSENTIAL : Configure 50x Pages
error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
# SECURITY : Deny all attempts to access hidden files .abcde
location ~ /\. {
    deny all;
}
# PERFORMANCE : Set expires headers for static files and turn off logging.
location ~* ^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
    access_log off; log_not_found off; expires 30d;
}

Configure wordpress.conf :

[root@vps-08 ~]# vi /etc/nginx/conf.d/wordpress.conf

Add the following and save :

# WORDPRESS : Rewrite rules, sends everything through index.php and keeps the appended query string intact
location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

# SECURITY : Deny all attempts to access PHP Files in the uploads directory
location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
}
# REQUIREMENTS : Enable PHP Support
location ~ \.php$ {
    # SECURITY : Zero day Exploit Protection
    try_files $uri =404;
    # ENABLE : Enable PHP, listen fpm sock
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# PLUGINS : Enable Rewrite Rules for SiteMap
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;

Create w3tc.conf file :

[root@vps ~]# vi /etc/nginx/conf.d/w3tc.conf

Add the following and save :

# BEGIN W3TC Page Cache core
set $w3tc_rewrite 1;
if ($request_method = POST) {
    set $w3tc_rewrite 0;
}
if ($query_string != "") {
    set $w3tc_rewrite 0;
}
if ($http_cookie ~* "(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)") {
    set $w3tc_rewrite 0;
}
if ($http_cookie ~* "(w3tc_preview)") {
    set $w3tc_rewrite _preview;
}
set $w3tc_enc "";
if ($http_accept_encoding ~ gzip) {
    set $w3tc_enc _gzip;
}
set $w3tc_ext "";
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite.html$w3tc_enc") {
    set $w3tc_ext .html;
}
if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite.xml$w3tc_enc") {
    set $w3tc_ext .xml;
}
if ($w3tc_ext = "") {
  set $w3tc_rewrite 0;
}
if ($w3tc_rewrite = 1) {
    rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite$w3tc_ext$w3tc_enc" last;
}
# END W3TC Page Cache core

d. Modify default.conf file :

[root@vps-08 ~]# vi /etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  localhost;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

# redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

5. Secure Mysql :

[root@vps-08 ~]# /usr/bin/mysql_secure_installation

Sample :

[root@vps-08 ~]# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


6. Configure php-fpm :

[root@vps-08 ~]# vi /etc/php-fpm.d/www.conf

Update and uncomment the following :

listen = /var/run/php-fpm.sock
..
listen.mode = 0666
..
user = nginx
group = nginx
..
pm = dynamic
..
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 10
pm.max_requests = 200
..
slowlog = /var/log/php-fpm/www-slow.log
..
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
..
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session

7. Restart the NGINX and php-fpm :
Restart the NGINX and php-fpm service to apply the changes on the configuration files.

[root@vps-08 ~]# service nginx restart; service php-fpm restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]

Check the service listened on your VPS :

[root@vps-08 ~]# netstat -plunt | grep LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1097/rpcbind
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      18070/nginx
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1130/sshd
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      18358/mysqld
tcp        0      0 :::111                      :::*                        LISTEN      1097/rpcbind
tcp        0      0 :::22                       :::*                        LISTEN      1130/sshd

Now you can start to setup WordPress blog into your VPS server.

setup nginx

How to Install Lighttpd With PHP5 (PHP-FPM) and MySQL on CentOS 6.5

Lighttpd (pronounced “lighty”) is an open-source web server as an alternative to Apache and Nginx. It is a secure, flexible, fast and designed for speed-critical environments. It has a low memory footprint and can handle large number of connections in one server especially for busier sites.

PHP is an acronym for “PHP Hypertext Preprocessor”; PHP is a widely-used server-side scripting language executed on the server.

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

MySQL is a popular database solution for use in web applications.

This post will show you how to install Lighttpd With PHP5 (PHP-FPM) and MySQL on CentOS 6.5 VPS or dedicated server.

1. EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server. How to Configure EPEL Repository on CentOS.

2. Install Lighttpd, MySQL and PHP5 work in Lighttpd through PHP-FPM :

[root@centos6-05 ~]# yum install lighttpd php php-fpm lighttpd-fastcgi php-mysql mysql mysql-server -y

3. Configure Lighttpd :

[root@centos6-05 ~]# vi /etc/lighttpd/lighttpd.conf
server.use-ipv6 = "enable"

Change to :

server.use-ipv6 = "disable"

4. Make lighttpd start at boot and also start lighttpd service:

[root@centos6-05 ~]# chkconfig --levels 235 lighttpd on
[root@centos6-05 ~]# /etc/init.d/lighttpd start

Browse your web server and Lighttpd welcome page should be displayed :
lighttpd-centos6.5-1

5. Configure PHP to work in Lighttpd through PHP-FPM :

[root@centos6-05 ~]# vi /etc/php-fpm.d/www.conf

Enable PHP-FPM use a TCP connection instead of unix socket :

;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

Configure user and group to lighttpd :

..
..
; RPM: apache Choosed to be able to access some dir as httpd
user = lighttpd
; RPM: Keep a group allowed to write in log dir.
group = lighttpd
..
..

6. Make php-fpm start at boot and also start the php-fpm service :

[root@centos6-05 ~]# chkconfig --levels 235 php-fpm on
[root@centos6-05 ~]# /etc/init.d/php-fpm start

7. Open and modify /etc/php.ini :

[root@centos6-05 ~]# vi /etc/php.ini

Uncomment the line cgi.fix_pathinfo=1

..
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
cgi.fix_pathinfo=1
..

8. Open and modify /etc/lighttpd/modules.conf :

[root@centos6-05 ~]# vi /etc/lighttpd/modules.conf

Uncomment the line include “conf.d/fastcgi.conf”:

..
## FastCGI (mod_fastcgi)
##
include "conf.d/fastcgi.conf"
..

9. Open and modify /etc/lighttpd/conf.d/fastcgi.conf :

Add below fastcgi.server at bottom of the file :

..
fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9000",
                "broken-scriptfilename" => "enable"
        ))
)
..

10. Reload the PHP-FPM and Lighttpd service :

[root@centos6-05 ~]# /etc/init.d/php-fpm reload
[root@centos6-05 ~]# /etc/init.d/lighttpd reload

11. Since MySQl has been install, dont forget to make MySQL start at boot and start the MySQL service :

[root@centos6-05 ~]# chkconfig --levels 235 mysqld on
[root@centos6-05 ~]# /etc/init.d/mysqld start

12. Create info.php under ligghttpd document root :

[root@centos6-05 ~]# vi /var/www/lighttpd/info.php
<?php
phpinfo();
?>

Browse your page http://IP-Adress/info.php. Thats all.

How to Install and Configure Apache2, PHP and MySQL 5.6 on Ubuntu 14.04

LAMP stack is a group of open source software that installed together to let you run a server to host dynamic websites. “L” stand for Linux, “A” stand for Apache (to host Web server), “M” stand for MySQL(to store database) and “P” stand for PHP(to process dynamic content). With the release of Ubuntu 14.04 on April 17 2014, i would share the steps to setup Apache2, PHP and MySQL on Ubuntu 14.04 in order to run a dynamic websites. This may useful for those who plan to run their websites on Virtual private server (VPS) or dedicated server.

1. Install Apache2, MySQL and PHP :

ehowstuff@ubuntu14:~$ sudo apt-get install apache2 php5 php5-cgi libapache2-mod-php5 php5-common php-pear mysql-server-5.6 -y

During this installation, you will require to set MySQL’s root password :
1

2

2. Backup the original Apache2 configuration file :

ehowstuff@ubuntu14:~$ sudo cp -p /etc/apache2/conf-enabled/security.conf /etc/apache2/conf-enabled/security.conf.bak

3. Open security.conf and modify the OS to become Prod. For security reason, Prod will tells apache to only return Apache in the Server header, returned on every page request.

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/conf-enabled/security.conf
..
..
ServerTokens Prod
..
..
ServerSignature Off
..
..

4. Add file extension that can be access :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
        DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

5. Specify server name :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/apache2.conf
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
ServerName ubuntu14.ehowstuff.local
#
# The accept se

6. Specify webmaster’s email :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/sites-enabled/000-default.conf

        ServerAdmin webmaster@ubuntu14.ehowstuff.local
        DocumentRoot /var/www/html

7. Restart web server apache2 :

ehowstuff@ubuntu14:~$ sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                             [ OK ]

8. Near line 220: add extension for PHP :

ehowstuff@ubuntu14:~$ sudo vi /etc/apache2/mods-enabled/mime.conf
..
..
AddHandler php5-script .php
..
..

9. Comment and add your timezone :

ehowstuff@ubuntu14:~$ sudo vi /etc/php5/apache2/php.ini
..
..
date.timezone = "Asia/Kuala Lumpur"
..
..

After change php.ini, restart the apache :

ehowstuff@ubuntu14:~$ sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                             [ OK ]

10. Connect to MySQL :

ehowstuff@ubuntu14:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.6.17-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

11. Show user info :

mysql> select user,host,password from mysql.user;
+------------------+-----------+-------------------------------------------+
| user             | host      | password                                  |
+------------------+-----------+-------------------------------------------+
| root             | localhost | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ubuntu14  | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | 127.0.0.1 | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ::1       | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| debian-sys-maint | localhost | *9C063813F4CC3C2E09995B0D043C7375C5E5538A |
+------------------+-----------+-------------------------------------------+
5 rows in set (0.00 sec)

12. Show databases :

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)

Done!!

Install MySQL, Apache and PHP on CentOS 6.5

LAMP stand for Linux, Apache, MySQL and PHP which is group of software used to run an web applications. The combination of these software is called LAMP stack. This document will walk you through the steps to install MySQL, Apache and PHP on CentOS 6.5.


What is Apache ?

Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.

What is MySQL?
MySQL Database server is one of the most popular used database in the internet especially for content management and blogging site.

What is PHP?
PHP is a widely-used and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML.

Steps :
1. Install MySQL, Apache and PHP :

[root@centos6-05 ~]# yum install mysql mysql-server httpd php* -y

2. Start Apache and MySQL :

[root@centos6-05 ~]# service httpd start
[root@centos6-05 ~]# service mysqld start

3. Check Apache, MySQL and PHP version :
Apache

[root@centos6-05 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28

MySQL

[root@centos6-05 ~]# mysql -V
mysql  Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1

PHP

[root@centos6-05 ~]# php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4. Verifying Apache, MySQL and PHP :

Create a page called phpinfo.php under web root directory /var/www/html.

[root@centos6-05 ~]# vi /var/www/html/index.php
<?php

     phpinfo ();
?>

Restart Apache :

[root@centos6-05 ~]# service httpd restart

php-info

How to Fix “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

Issue :

When i try to install WordPress, I’ve encountered this error and returned the following warning on browser :

“Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

Solution :

The reason for this is your existing PHP does not support mysql or php-mysql extension does not installed. To overcome this issue, just install php mysql support using below command on your virtual private server (VPS) or your dedicated web server.
1. Install php with mysql extension :

yum install php-mysql -y

2. Restart httpd :

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

Example :

[root@centos64 html]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.upsi.edu.my
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.upsi.edu.my
 * updates: mirror.upsi.edu.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: php-pdo(x86-64) for package: php-mysql-5.3.3-22.el6.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                 Arch                 Version                      Repository          Size
====================================================================================================
Installing:
 php-mysql               x86_64               5.3.3-22.el6                 base                81 k
Installing for dependencies:
 php-pdo                 x86_64               5.3.3-22.el6                 base                75 k

Transaction Summary
====================================================================================================
Install       2 Package(s)

Total download size: 155 k
Installed size: 383 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-mysql-5.3.3-22.el6.x86_64.rpm                                     |  81 kB     00:00
(2/2): php-pdo-5.3.3-22.el6.x86_64.rpm                                       |  75 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                               137 kB/s | 155 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-pdo-5.3.3-22.el6.x86_64                                                      1/2
  Installing : php-mysql-5.3.3-22.el6.x86_64                                                    2/2
  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                      1/2
  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                    2/2

Installed:
  php-mysql.x86_64 0:5.3.3-22.el6

Dependency Installed:
  php-pdo.x86_64 0:5.3.3-22.el6

Complete!

How to Install and Configure PHP 5.3.3 on CentOS 6.4

phpPHP is a widely-used and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML. PHP applications are commonly found with the filename extensions .php, .php4, or .php5. You can read more information about PHP from their website at www.php.net. The following step will install full PHP package.

1. Install PHP using yum command :

[root@centos64 ~]# yum install php* -y

Example :

[root@centos64 ~]# yum install php* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.3-22.el6.x86_64
--> Processing Dependency: httpd for package: php-5.3.3-22.el6.x86_64
---> Package php-bcmath.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-cli.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-common.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-dba.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-devel.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: automake for package: php-devel-5.3.3-22.el6.x86_64
--> Processing Dependency: autoconf for package: php-devel-5.3.3-22.el6.x86_64
---> Package php-embedded.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-enchant.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libenchant.so.1()(64bit) for package: php-enchant-5.3.3-22.el6.x86_64
---> Package php-fpm.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-gd.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: php-gd-5.3.3-22.el6.x86_64
---> Package php-imap.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php-imap-5.3.3-22.el6.x86_64
---> Package php-intl.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libicuuc.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicuio.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicui18n.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
--> Processing Dependency: libicudata.so.42()(64bit) for package: php-intl-5.3.3-22.el6.x86_64
---> Package php-ldap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mbstring.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-odbc.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libodbc.so.2()(64bit) for package: php-odbc-5.3.3-22.el6.x86_64
---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
---> Package php-pecl-apc.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-apc-devel.x86_64 0:3.1.9-2.el6 will be installed
---> Package php-pecl-memcache.x86_64 0:3.0.5-4.el6 will be installed
---> Package php-pgsql.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpq.so.5()(64bit) for package: php-pgsql-5.3.3-22.el6.x86_64
---> Package php-process.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-pspell.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libpspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
--> Processing Dependency: libaspell.so.15()(64bit) for package: php-pspell-5.3.3-22.el6.x86_64
---> Package php-recode.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.3.3-22.el6.x86_64
---> Package php-snmp.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: net-snmp for package: php-snmp-5.3.3-22.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: php-snmp-5.3.3-22.el6.x86_64
---> Package php-soap.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-tidy.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.3.3-22.el6.x86_64
---> Package php-xml.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.3.3-22.el6.x86_64
---> Package php-xmlrpc.x86_64 0:5.3.3-22.el6 will be installed
---> Package php-zts.x86_64 0:5.3.3-22.el6 will be installed
--> Running transaction check
---> Package aspell.x86_64 12:0.60.6-12.el6 will be installed
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
---> Package enchant.x86_64 1:1.5.0-4.el6 will be installed
--> Processing Dependency: libhunspell-1.2.so.0()(64bit) for package: 1:enchant-1.5.0-4.el6.x86_64
---> Package freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package httpd.x86_64 0:2.2.15-26.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.15-26.el6.centos for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-26.el6.centos.x86_64
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
---> Package libc-client.x86_64 0:2007e-11.el6 will be installed
---> Package libicu.x86_64 0:4.2.1-9.1.el6_2 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-1.el6 will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
---> Package libxslt.x86_64 0:1.1.26-2.el6_3.1 will be installed
---> Package net-snmp.x86_64 1:5.5-44.el6 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.5-44.el6.x86_64
---> Package net-snmp-libs.x86_64 1:5.5-44.el6 will be installed
---> Package postgresql-libs.x86_64 0:8.4.13-1.el6_3 will be installed
---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
---> Package unixODBC.x86_64 0:2.2.14-12.el6_3 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-12.el6_3.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-26.el6.centos will be installed
---> Package hunspell.x86_64 0:1.2.8-16.el6 will be installed
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                       Arch              Version                             Repository          Size
==============================================================================================================
Installing:
 php                           x86_64            5.3.3-22.el6                        base               1.1 M
 php-bcmath                    x86_64            5.3.3-22.el6                        base                34 k
 php-cli                       x86_64            5.3.3-22.el6                        base               2.2 M
 php-common                    x86_64            5.3.3-22.el6                        base               524 k
 php-dba                       x86_64            5.3.3-22.el6                        base                40 k
 php-devel                     x86_64            5.3.3-22.el6                        base               507 k
 php-embedded                  x86_64            5.3.3-22.el6                        base               1.1 M
 php-enchant                   x86_64            5.3.3-22.el6                        base                28 k
 php-fpm                       x86_64            5.3.3-22.el6                        base               1.1 M
 php-gd                        x86_64            5.3.3-22.el6                        base               106 k
 php-imap                      x86_64            5.3.3-22.el6                        base                50 k
 php-intl                      x86_64            5.3.3-22.el6                        base                70 k
 php-ldap                      x86_64            5.3.3-22.el6                        base                38 k
 php-mbstring                  x86_64            5.3.3-22.el6                        base               455 k
 php-mysql                     x86_64            5.3.3-22.el6                        base                81 k
 php-odbc                      x86_64            5.3.3-22.el6                        base                50 k
 php-pdo                       x86_64            5.3.3-22.el6                        base                75 k
 php-pear                      noarch            1:1.9.4-4.el6                       base               393 k
 php-pecl-apc                  x86_64            3.1.9-2.el6                         base                96 k
 php-pecl-apc-devel            x86_64            3.1.9-2.el6                         base               6.7 k
 php-pecl-memcache             x86_64            3.0.5-4.el6                         base                60 k
 php-pgsql                     x86_64            5.3.3-22.el6                        base                70 k
 php-process                   x86_64            5.3.3-22.el6                        base                39 k
 php-pspell                    x86_64            5.3.3-22.el6                        base                28 k
 php-recode                    x86_64            5.3.3-22.el6                        base                25 k
 php-snmp                      x86_64            5.3.3-22.el6                        base                30 k
 php-soap                      x86_64            5.3.3-22.el6                        base               139 k
 php-tidy                      x86_64            5.3.3-22.el6                        base                35 k
 php-xml                       x86_64            5.3.3-22.el6                        base               103 k
 php-xmlrpc                    x86_64            5.3.3-22.el6                        base                52 k
 php-zts                       x86_64            5.3.3-22.el6                        base               1.2 M
Installing for dependencies:
 apr                           x86_64            1.3.9-5.el6_2                       base               123 k
 apr-util                      x86_64            1.3.9-3.el6_0.1                     base                87 k
 apr-util-ldap                 x86_64            1.3.9-3.el6_0.1                     base                15 k
 aspell                        x86_64            12:0.60.6-12.el6                    base               648 k
 autoconf                      noarch            2.63-5.1.el6                        base               781 k
 automake                      noarch            1.11.1-4.el6                        base               550 k
 enchant                       x86_64            1:1.5.0-4.el6                       base                49 k
 freetype                      x86_64            2.3.11-14.el6_3.1                   updates            359 k
 httpd                         x86_64            2.2.15-26.el6.centos                base               821 k
 httpd-tools                   x86_64            2.2.15-26.el6.centos                base                72 k
 hunspell                      x86_64            1.2.8-16.el6                        base               177 k
 libX11                        x86_64            1.5.0-4.el6                         base               584 k
 libX11-common                 noarch            1.5.0-4.el6                         base               192 k
 libXau                        x86_64            1.0.6-4.el6                         base                24 k
 libXpm                        x86_64            3.5.10-2.el6                        base                51 k
 libc-client                   x86_64            2007e-11.el6                        base               515 k
 libicu                        x86_64            4.2.1-9.1.el6_2                     base               4.9 M
 libjpeg-turbo                 x86_64            1.2.1-1.el6                         base               174 k
 libpng                        x86_64            2:1.2.49-1.el6_2                    base               182 k
 libtidy                       x86_64            0.99.0-19.20070615.1.el6            base               127 k
 libtool-ltdl                  x86_64            2.2.6-15.5.el6                      base                44 k
 libxcb                        x86_64            1.8.1-1.el6                         base               110 k
 libxslt                       x86_64            1.1.26-2.el6_3.1                    base               452 k
 lm_sensors-libs               x86_64            3.1.1-17.el6                        base                38 k
 mailcap                       noarch            2.1.31-2.el6                        base                27 k
 net-snmp                      x86_64            1:5.5-44.el6                        base               303 k
 net-snmp-libs                 x86_64            1:5.5-44.el6                        base               1.5 M
 postgresql-libs               x86_64            8.4.13-1.el6_3                      base               200 k
 recode                        x86_64            3.6-28.1.el6                        base               712 k
 unixODBC                      x86_64            2.2.14-12.el6_3                     base               378 k

Transaction Summary
==============================================================================================================
Install      61 Package(s)

Total download size: 24 M
Installed size: 82 M
Downloading Packages:
(1/61): apr-1.3.9-5.el6_2.x86_64.rpm                                                   | 123 kB     00:02
(2/61): apr-util-1.3.9-3.el6_0.1.x86_64.rpm                                            |  87 kB     00:00
(3/61): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm                                       |  15 kB     00:00
(4/61): aspell-0.60.6-12.el6.x86_64.rpm                                                | 648 kB     00:08
(5/61): autoconf-2.63-5.1.el6.noarch.rpm                                               | 781 kB     00:06
(6/61): automake-1.11.1-4.el6.noarch.rpm                                               | 550 kB     00:06
(7/61): enchant-1.5.0-4.el6.x86_64.rpm                                                 |  49 kB     00:00
(8/61): freetype-2.3.11-14.el6_3.1.x86_64.rpm                                          | 359 kB     00:04
(9/61): httpd-2.2.15-26.el6.centos.x86_64.rpm                                          | 821 kB     00:18
(10/61): httpd-tools-2.2.15-26.el6.centos.x86_64.rpm                                   |  72 kB     00:00
(11/61): hunspell-1.2.8-16.el6.x86_64.rpm                                              | 177 kB     00:01
(12/61): libX11-1.5.0-4.el6.x86_64.rpm                                                 | 584 kB     00:10
(13/61): libX11-common-1.5.0-4.el6.noarch.rpm                                          | 192 kB     00:01
(14/61): libXau-1.0.6-4.el6.x86_64.rpm                                                 |  24 kB     00:00
(15/61): libXpm-3.5.10-2.el6.x86_64.rpm                                                |  51 kB     00:00
(16/61): libc-client-2007e-11.el6.x86_64.rpm                                           | 515 kB     00:05
(17/61): libicu-4.2.1-9.1.el6_2.x86_64.rpm                                             | 4.9 MB     00:54
(18/61): libjpeg-turbo-1.2.1-1.el6.x86_64.rpm                                          | 174 kB     00:02
(19/61): libpng-1.2.49-1.el6_2.x86_64.rpm                                              | 182 kB     00:01
(20/61): libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm                                   | 127 kB     00:01
(21/61): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm                                        |  44 kB     00:00
(22/61): libxcb-1.8.1-1.el6.x86_64.rpm                                                 | 110 kB     00:00
(23/61): libxslt-1.1.26-2.el6_3.1.x86_64.rpm                                           | 452 kB     00:03
(24/61): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm                                       |  38 kB     00:01
(25/61): mailcap-2.1.31-2.el6.noarch.rpm                                               |  27 kB     00:00
(26/61): net-snmp-5.5-44.el6.x86_64.rpm                                                | 303 kB     00:03
(27/61): net-snmp-libs-5.5-44.el6.x86_64.rpm                                           | 1.5 MB     00:17
(28/61): php-5.3.3-22.el6.x86_64.rpm                                                   | 1.1 MB     00:11
(29/61): php-bcmath-5.3.3-22.el6.x86_64.rpm                                            |  34 kB     00:00
(30/61): php-cli-5.3.3-22.el6.x86_64.rpm                                               | 2.2 MB     00:24
(31/61): php-common-5.3.3-22.el6.x86_64.rpm                                            | 524 kB     00:07
(32/61): php-dba-5.3.3-22.el6.x86_64.rpm                                               |  40 kB     00:00
(33/61): php-devel-5.3.3-22.el6.x86_64.rpm                                             | 507 kB     00:04
(34/61): php-embedded-5.3.3-22.el6.x86_64.rpm                                          | 1.1 MB     00:10
(35/61): php-enchant-5.3.3-22.el6.x86_64.rpm                                           |  28 kB     00:00
(36/61): php-fpm-5.3.3-22.el6.x86_64.rpm                                               | 1.1 MB     00:11
(37/61): php-gd-5.3.3-22.el6.x86_64.rpm                                                | 106 kB     00:00
(38/61): php-imap-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:01
(39/61): php-intl-5.3.3-22.el6.x86_64.rpm                                              |  70 kB     00:00
(40/61): php-ldap-5.3.3-22.el6.x86_64.rpm                                              |  38 kB     00:00
(41/61): php-mbstring-5.3.3-22.el6.x86_64.rpm                                          | 455 kB     00:05
(42/61): php-mysql-5.3.3-22.el6.x86_64.rpm                                             |  81 kB     00:00
(43/61): php-odbc-5.3.3-22.el6.x86_64.rpm                                              |  50 kB     00:00
(44/61): php-pdo-5.3.3-22.el6.x86_64.rpm                                               |  75 kB     00:00
(45/61): php-pear-1.9.4-4.el6.noarch.rpm                                               | 393 kB     00:12
(46/61): php-pecl-apc-3.1.9-2.el6.x86_64.rpm                                           |  96 kB     00:00
(47/61): php-pecl-apc-devel-3.1.9-2.el6.x86_64.rpm                                     | 6.7 kB     00:00
(48/61): php-pecl-memcache-3.0.5-4.el6.x86_64.rpm                                      |  60 kB     00:00
(49/61): php-pgsql-5.3.3-22.el6.x86_64.rpm                                             |  70 kB     00:00
(50/61): php-process-5.3.3-22.el6.x86_64.rpm                                           |  39 kB     00:00
(51/61): php-pspell-5.3.3-22.el6.x86_64.rpm                                            |  28 kB     00:00
(52/61): php-recode-5.3.3-22.el6.x86_64.rpm                                            |  25 kB     00:00
(53/61): php-snmp-5.3.3-22.el6.x86_64.rpm                                              |  30 kB     00:00
(54/61): php-soap-5.3.3-22.el6.x86_64.rpm                                              | 139 kB     00:01
(55/61): php-tidy-5.3.3-22.el6.x86_64.rpm                                              |  35 kB     00:00
(56/61): php-xml-5.3.3-22.el6.x86_64.rpm                                               | 103 kB     00:00
(57/61): php-xmlrpc-5.3.3-22.el6.x86_64.rpm                                            |  52 kB     00:00
(58/61): php-zts-5.3.3-22.el6.x86_64.rpm                                               | 1.2 MB     00:17
(59/61): postgresql-libs-8.4.13-1.el6_3.x86_64.rpm                                     | 200 kB     00:01
(60/61): recode-3.6-28.1.el6.x86_64.rpm                                                | 712 kB     00:06
(61/61): unixODBC-2.2.14-12.el6_3.x86_64.rpm                                           | 378 kB     00:02
--------------------------------------------------------------------------------------------------------------
Total                                                                          82 kB/s |  24 MB     04:56
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-22.el6.x86_64                                                            1/61
  Installing : php-pdo-5.3.3-22.el6.x86_64                                                               2/61
  Installing : apr-1.3.9-5.el6_2.x86_64                                                                  3/61
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                           4/61
  Installing : php-cli-5.3.3-22.el6.x86_64                                                               5/61
  Installing : 1:php-pear-1.9.4-4.el6.noarch                                                             6/61
  Installing : lm_sensors-libs-3.1.1-17.el6.x86_64                                                       7/61
  Installing : 1:net-snmp-libs-5.5-44.el6.x86_64                                                         8/61
  Installing : autoconf-2.63-5.1.el6.noarch                                                              9/61
  Installing : automake-1.11.1-4.el6.noarch                                                             10/61
  Installing : 1:net-snmp-5.5-44.el6.x86_64                                                             11/61
  Installing : php-pecl-apc-3.1.9-2.el6.x86_64                                                          12/61
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                     13/61
  Installing : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  14/61
  Installing : libXau-1.0.6-4.el6.x86_64                                                                15/61
  Installing : libxcb-1.8.1-1.el6.x86_64                                                                16/61
  Installing : libX11-common-1.5.0-4.el6.noarch                                                         17/61
  Installing : libX11-1.5.0-4.el6.x86_64                                                                18/61
  Installing : libXpm-3.5.10-2.el6.x86_64                                                               19/61
  Installing : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    20/61
  Installing : mailcap-2.1.31-2.el6.noarch                                                              21/61
  Installing : httpd-2.2.15-26.el6.centos.x86_64                                                        22/61
  Installing : php-5.3.3-22.el6.x86_64                                                                  23/61
  Installing : php-devel-5.3.3-22.el6.x86_64                                                            24/61
  Installing : 2:libpng-1.2.49-1.el6_2.x86_64                                                           25/61
  Installing : libxslt-1.1.26-2.el6_3.1.x86_64                                                          26/61
  Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       27/61
  Installing : unixODBC-2.2.14-12.el6_3.x86_64                                                          28/61
  Installing : libicu-4.2.1-9.1.el6_2.x86_64                                                            29/61
  Installing : recode-3.6-28.1.el6.x86_64                                                               30/61
  Installing : libc-client-2007e-11.el6.x86_64                                                          31/61
  Installing : freetype-2.3.11-14.el6_3.1.x86_64                                                        32/61
  Installing : 12:aspell-0.60.6-12.el6.x86_64                                                           33/61
  Installing : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                  34/61
  Installing : libjpeg-turbo-1.2.1-1.el6.x86_64                                                         35/61
  Installing : hunspell-1.2.8-16.el6.x86_64                                                             36/61
  Installing : 1:enchant-1.5.0-4.el6.x86_64                                                             37/61
  Installing : php-enchant-5.3.3-22.el6.x86_64                                                          38/61
  Installing : php-gd-5.3.3-22.el6.x86_64                                                               39/61
  Installing : php-tidy-5.3.3-22.el6.x86_64                                                             40/61
  Installing : php-pspell-5.3.3-22.el6.x86_64                                                           41/61
  Installing : php-imap-5.3.3-22.el6.x86_64                                                             42/61
  Installing : php-recode-5.3.3-22.el6.x86_64                                                           43/61
  Installing : php-intl-5.3.3-22.el6.x86_64                                                             44/61
  Installing : php-odbc-5.3.3-22.el6.x86_64                                                             45/61
  Installing : php-xml-5.3.3-22.el6.x86_64                                                              46/61
  Installing : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    47/61
  Installing : php-zts-5.3.3-22.el6.x86_64                                                              48/61
  Installing : php-pgsql-5.3.3-22.el6.x86_64                                                            49/61
  Installing : php-snmp-5.3.3-22.el6.x86_64                                                             50/61
  Installing : php-pecl-memcache-3.0.5-4.el6.x86_64                                                     51/61
  Installing : php-mysql-5.3.3-22.el6.x86_64                                                            52/61
  Installing : php-bcmath-5.3.3-22.el6.x86_64                                                           53/61
  Installing : php-fpm-5.3.3-22.el6.x86_64                                                              54/61
  Installing : php-xmlrpc-5.3.3-22.el6.x86_64                                                           55/61
  Installing : php-dba-5.3.3-22.el6.x86_64                                                              56/61
  Installing : php-mbstring-5.3.3-22.el6.x86_64                                                         57/61
  Installing : php-ldap-5.3.3-22.el6.x86_64                                                             58/61
  Installing : php-process-5.3.3-22.el6.x86_64                                                          59/61
  Installing : php-soap-5.3.3-22.el6.x86_64                                                             60/61
  Installing : php-embedded-5.3.3-22.el6.x86_64                                                         61/61
  Verifying  : hunspell-1.2.8-16.el6.x86_64                                                              1/61
  Verifying  : httpd-2.2.15-26.el6.centos.x86_64                                                         2/61
  Verifying  : php-recode-5.3.3-22.el6.x86_64                                                            3/61
  Verifying  : libjpeg-turbo-1.2.1-1.el6.x86_64                                                          4/61
  Verifying  : libtidy-0.99.0-19.20070615.1.el6.x86_64                                                   5/61
  Verifying  : libxcb-1.8.1-1.el6.x86_64                                                                 6/61
  Verifying  : libXpm-3.5.10-2.el6.x86_64                                                                7/61
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                      8/61
  Verifying  : php-pecl-memcache-3.0.5-4.el6.x86_64                                                      9/61
  Verifying  : 12:aspell-0.60.6-12.el6.x86_64                                                           10/61
  Verifying  : php-bcmath-5.3.3-22.el6.x86_64                                                           11/61
  Verifying  : php-fpm-5.3.3-22.el6.x86_64                                                              12/61
  Verifying  : php-devel-5.3.3-22.el6.x86_64                                                            13/61
  Verifying  : 1:php-pear-1.9.4-4.el6.noarch                                                            14/61
  Verifying  : php-pspell-5.3.3-22.el6.x86_64                                                           15/61
  Verifying  : php-xml-5.3.3-22.el6.x86_64                                                              16/61
  Verifying  : httpd-tools-2.2.15-26.el6.centos.x86_64                                                  17/61
  Verifying  : freetype-2.3.11-14.el6_3.1.x86_64                                                        18/61
  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                            19/61
  Verifying  : php-enchant-5.3.3-22.el6.x86_64                                                          20/61
  Verifying  : libX11-1.5.0-4.el6.x86_64                                                                21/61
  Verifying  : unixODBC-2.2.14-12.el6_3.x86_64                                                          22/61
  Verifying  : automake-1.11.1-4.el6.noarch                                                             23/61
  Verifying  : php-gd-5.3.3-22.el6.x86_64                                                               24/61
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                          25/61
  Verifying  : php-tidy-5.3.3-22.el6.x86_64                                                             26/61
  Verifying  : php-cli-5.3.3-22.el6.x86_64                                                              27/61
  Verifying  : libc-client-2007e-11.el6.x86_64                                                          28/61
  Verifying  : php-common-5.3.3-22.el6.x86_64                                                           29/61
  Verifying  : 1:enchant-1.5.0-4.el6.x86_64                                                             30/61
  Verifying  : recode-3.6-28.1.el6.x86_64                                                               31/61
  Verifying  : php-pecl-apc-3.1.9-2.el6.x86_64                                                          32/61
  Verifying  : libicu-4.2.1-9.1.el6_2.x86_64                                                            33/61
  Verifying  : autoconf-2.63-5.1.el6.noarch                                                             34/61
  Verifying  : libtool-ltdl-2.2.6-15.5.el6.x86_64                                                       35/61
  Verifying  : libxslt-1.1.26-2.el6_3.1.x86_64                                                          36/61
  Verifying  : 2:libpng-1.2.49-1.el6_2.x86_64                                                           37/61
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                              38/61
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                 39/61
  Verifying  : 1:net-snmp-5.5-44.el6.x86_64                                                             40/61
  Verifying  : php-xmlrpc-5.3.3-22.el6.x86_64                                                           41/61
  Verifying  : postgresql-libs-8.4.13-1.el6_3.x86_64                                                    42/61
  Verifying  : php-odbc-5.3.3-22.el6.x86_64                                                             43/61
  Verifying  : libX11-common-1.5.0-4.el6.noarch                                                         44/61
  Verifying  : php-imap-5.3.3-22.el6.x86_64                                                             45/61
  Verifying  : php-dba-5.3.3-22.el6.x86_64                                                              46/61
  Verifying  : php-mbstring-5.3.3-22.el6.x86_64                                                         47/61
  Verifying  : php-ldap-5.3.3-22.el6.x86_64                                                             48/61
  Verifying  : php-5.3.3-22.el6.x86_64                                                                  49/61
  Verifying  : php-pecl-apc-devel-3.1.9-2.el6.x86_64                                                    50/61
  Verifying  : 1:net-snmp-libs-5.5-44.el6.x86_64                                                        51/61
  Verifying  : php-pgsql-5.3.3-22.el6.x86_64                                                            52/61
  Verifying  : php-snmp-5.3.3-22.el6.x86_64                                                             53/61
  Verifying  : libXau-1.0.6-4.el6.x86_64                                                                54/61
  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                              55/61
  Verifying  : lm_sensors-libs-3.1.1-17.el6.x86_64                                                      56/61
  Verifying  : php-process-5.3.3-22.el6.x86_64                                                          57/61
  Verifying  : php-soap-5.3.3-22.el6.x86_64                                                             58/61
  Verifying  : php-embedded-5.3.3-22.el6.x86_64                                                         59/61
  Verifying  : php-intl-5.3.3-22.el6.x86_64                                                             60/61
  Verifying  : php-zts-5.3.3-22.el6.x86_64                                                              61/61

Installed:
  php.x86_64 0:5.3.3-22.el6                             php-bcmath.x86_64 0:5.3.3-22.el6
  php-cli.x86_64 0:5.3.3-22.el6                         php-common.x86_64 0:5.3.3-22.el6
  php-dba.x86_64 0:5.3.3-22.el6                         php-devel.x86_64 0:5.3.3-22.el6
  php-embedded.x86_64 0:5.3.3-22.el6                    php-enchant.x86_64 0:5.3.3-22.el6
  php-fpm.x86_64 0:5.3.3-22.el6                         php-gd.x86_64 0:5.3.3-22.el6
  php-imap.x86_64 0:5.3.3-22.el6                        php-intl.x86_64 0:5.3.3-22.el6
  php-ldap.x86_64 0:5.3.3-22.el6                        php-mbstring.x86_64 0:5.3.3-22.el6
  php-mysql.x86_64 0:5.3.3-22.el6                       php-odbc.x86_64 0:5.3.3-22.el6
  php-pdo.x86_64 0:5.3.3-22.el6                         php-pear.noarch 1:1.9.4-4.el6
  php-pecl-apc.x86_64 0:3.1.9-2.el6                     php-pecl-apc-devel.x86_64 0:3.1.9-2.el6
  php-pecl-memcache.x86_64 0:3.0.5-4.el6                php-pgsql.x86_64 0:5.3.3-22.el6
  php-process.x86_64 0:5.3.3-22.el6                     php-pspell.x86_64 0:5.3.3-22.el6
  php-recode.x86_64 0:5.3.3-22.el6                      php-snmp.x86_64 0:5.3.3-22.el6
  php-soap.x86_64 0:5.3.3-22.el6                        php-tidy.x86_64 0:5.3.3-22.el6
  php-xml.x86_64 0:5.3.3-22.el6                         php-xmlrpc.x86_64 0:5.3.3-22.el6
  php-zts.x86_64 0:5.3.3-22.el6

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2                           apr-util.x86_64 0:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1               aspell.x86_64 12:0.60.6-12.el6
  autoconf.noarch 0:2.63-5.1.el6                       automake.noarch 0:1.11.1-4.el6
  enchant.x86_64 1:1.5.0-4.el6                         freetype.x86_64 0:2.3.11-14.el6_3.1
  httpd.x86_64 0:2.2.15-26.el6.centos                  httpd-tools.x86_64 0:2.2.15-26.el6.centos
  hunspell.x86_64 0:1.2.8-16.el6                       libX11.x86_64 0:1.5.0-4.el6
  libX11-common.noarch 0:1.5.0-4.el6                   libXau.x86_64 0:1.0.6-4.el6
  libXpm.x86_64 0:3.5.10-2.el6                         libc-client.x86_64 0:2007e-11.el6
  libicu.x86_64 0:4.2.1-9.1.el6_2                      libjpeg-turbo.x86_64 0:1.2.1-1.el6
  libpng.x86_64 2:1.2.49-1.el6_2                       libtidy.x86_64 0:0.99.0-19.20070615.1.el6
  libtool-ltdl.x86_64 0:2.2.6-15.5.el6                 libxcb.x86_64 0:1.8.1-1.el6
  libxslt.x86_64 0:1.1.26-2.el6_3.1                    lm_sensors-libs.x86_64 0:3.1.1-17.el6
  mailcap.noarch 0:2.1.31-2.el6                        net-snmp.x86_64 1:5.5-44.el6
  net-snmp-libs.x86_64 1:5.5-44.el6                    postgresql-libs.x86_64 0:8.4.13-1.el6_3
  recode.x86_64 0:3.6-28.1.el6                         unixODBC.x86_64 0:2.2.14-12.el6_3

Complete!

2. Check and verify the installed PHP packages :

[root@centos64 ~]# rpm -qa | grep php
php-gd-5.3.3-22.el6.x86_64
php-pspell-5.3.3-22.el6.x86_64
php-recode-5.3.3-22.el6.x86_64
php-odbc-5.3.3-22.el6.x86_64
php-pecl-apc-devel-3.1.9-2.el6.x86_64
php-pgsql-5.3.3-22.el6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-bcmath-5.3.3-22.el6.x86_64
php-xmlrpc-5.3.3-22.el6.x86_64
php-mbstring-5.3.3-22.el6.x86_64
php-process-5.3.3-22.el6.x86_64
php-embedded-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-pecl-apc-3.1.9-2.el6.x86_64
php-devel-5.3.3-22.el6.x86_64
php-enchant-5.3.3-22.el6.x86_64
php-tidy-5.3.3-22.el6.x86_64
php-imap-5.3.3-22.el6.x86_64
php-intl-5.3.3-22.el6.x86_64
php-xml-5.3.3-22.el6.x86_64
php-zts-5.3.3-22.el6.x86_64
php-snmp-5.3.3-22.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
php-fpm-5.3.3-22.el6.x86_64
php-dba-5.3.3-22.el6.x86_64
php-ldap-5.3.3-22.el6.x86_64
php-soap-5.3.3-22.el6.x86_64
php-common-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-5.3.3-22.el6.x86_64

3. Verify PHP Version :

[root@centos64 ~]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4. Do backup original php.ini :

[root@centos64 ~]# cp -a /etc/php.ini /etc/php.ini.15032013

5. Configure PHP :

[root@centos64 ~]# vi /etc/php.ini

a. Increase PHP script memory limit :

memory_limit = 128M

b. ncrease PHP script max execution time :

max_execution_time = 120

c. Increase PHP script max upload size :

upload_max_filesize = 50M

6. Restart Apache Server :

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

How to Install PHP 5.3 on CentOS 5.9

phpThis post focus on how to install PHP 5.3 on CentOS 5.9. PHP: Hypertext Preprocessor is a widely used, free and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML. PHP applications are commonly found with the filename extensions .php, .php4, or .php5. Follow this steps to install php 5.3.

Syntax :

[root@centos59 ~]# yum install php53*

or

[root@centos59 ~]# yum install php53* -y

Example :

[root@centos59 ~]# yum install php53*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nus.edu.sg
 * extras: mirror.nus.edu.sg
 * updates: mirror.nus.edu.sg
Setting up Install Process
Resolving Dependencies
--> Running transaction check
..
..
..
Dependencies Resolved

====================================================================================================
 Package                      Arch              Version                     Repository         Size
====================================================================================================
Installing:
 php53                        i386              5.3.3-13.el5_8              base              1.3 M
 php53-bcmath                 i386              5.3.3-13.el5_8              base               43 k
 php53-cli                    i386              5.3.3-13.el5_8              base              2.5 M
 php53-common                 i386              5.3.3-13.el5_8              base              605 k
 php53-dba                    i386              5.3.3-13.el5_8              base               40 k
 php53-devel                  i386              5.3.3-13.el5_8              base              592 k
 php53-gd                     i386              5.3.3-13.el5_8              base              109 k
 php53-imap                   i386              5.3.3-13.el5_8              base               51 k
 php53-intl                   i386              5.3.3-13.el5_8              base               74 k
 php53-ldap                   i386              5.3.3-13.el5_8              base               36 k
 php53-mbstring               i386              5.3.3-13.el5_8              base              1.2 M
 php53-mysql                  i386              5.3.3-13.el5_8              base               88 k
 php53-odbc                   i386              5.3.3-13.el5_8              base               52 k
 php53-pdo                    i386              5.3.3-13.el5_8              base               67 k
 php53-pgsql                  i386              5.3.3-13.el5_8              base               73 k
 php53-process                i386              5.3.3-13.el5_8              base               38 k
 php53-pspell                 i386              5.3.3-13.el5_8              base               26 k
 php53-snmp                   i386              5.3.3-13.el5_8              base               29 k
 php53-soap                   i386              5.3.3-13.el5_8              base              147 k
 php53-xml                    i386              5.3.3-13.el5_8              base              113 k
 php53-xmlrpc                 i386              5.3.3-13.el5_8              base               53 k

Transaction Summary
====================================================================================================
Install      21 Package(s)
Upgrade       0 Package(s)

Total download size: 7.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): php53-pspell-5.3.3-13.el5_8.i386.rpm                                 |  26 kB     00:00
(2/21): php53-snmp-5.3.3-13.el5_8.i386.rpm                                   |  29 kB     00:00
(3/21): php53-ldap-5.3.3-13.el5_8.i386.rpm                                   |  36 kB     00:00
(4/21): php53-process-5.3.3-13.el5_8.i386.rpm                                |  38 kB     00:00
(5/21): php53-dba-5.3.3-13.el5_8.i386.rpm                                    |  40 kB     00:00
(6/21): php53-bcmath-5.3.3-13.el5_8.i386.rpm                                 |  43 kB     00:00
(7/21): php53-imap-5.3.3-13.el5_8.i386.rpm                                   |  51 kB     00:00
(8/21): php53-odbc-5.3.3-13.el5_8.i386.rpm                                   |  52 kB     00:00
(9/21): php53-xmlrpc-5.3.3-13.el5_8.i386.rpm                                 |  53 kB     00:00
(10/21): php53-pdo-5.3.3-13.el5_8.i386.rpm                                   |  67 kB     00:00
(11/21): php53-pgsql-5.3.3-13.el5_8.i386.rpm                                 |  73 kB     00:00
(12/21): php53-intl-5.3.3-13.el5_8.i386.rpm                                  |  74 kB     00:00
(13/21): php53-mysql-5.3.3-13.el5_8.i386.rpm                                 |  88 kB     00:00
(14/21): php53-gd-5.3.3-13.el5_8.i386.rpm                                    | 109 kB     00:00
(15/21): php53-xml-5.3.3-13.el5_8.i386.rpm                                   | 113 kB     00:00
(16/21): php53-soap-5.3.3-13.el5_8.i386.rpm                                  | 147 kB     00:01
(17/21): php53-devel-5.3.3-13.el5_8.i386.rpm                                 | 592 kB     00:04
(18/21): php53-common-5.3.3-13.el5_8.i386.rpm                                | 605 kB     00:05
(19/21): php53-mbstring-5.3.3-13.el5_8.i386.rpm                              | 1.2 MB     00:10
(20/21): php53-5.3.3-13.el5_8.i386.rpm                                       | 1.3 MB     00:11
(21/21): php53-cli-5.3.3-13.el5_8.i386.rpm                                   | 2.5 MB     00:23
----------------------------------------------------------------------------------------------------
Total                                                               107 kB/s | 7.1 MB     01:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php53-common                                                                1/21
  Installing     : php53-pdo                                                                   2/21
  Installing     : php53-cli                                                                   3/21
  Installing     : php53                                                                       4/21
  Installing     : php53-ldap                                                                  5/21
  Installing     : php53-mysql                                                                 6/21
  Installing     : php53-process                                                               7/21
  Installing     : php53-soap                                                                  8/21
  Installing     : php53-intl                                                                  9/21
  Installing     : php53-pgsql                                                                10/21
  Installing     : php53-devel                                                                11/21
  Installing     : php53-xmlrpc                                                               12/21
  Installing     : php53-imap                                                                 13/21
  Installing     : php53-gd                                                                   14/21
  Installing     : php53-dba                                                                  15/21
  Installing     : php53-pspell                                                               16/21
  Installing     : php53-bcmath                                                               17/21
  Installing     : php53-xml                                                                  18/21
  Installing     : php53-snmp                                                                 19/21
  Installing     : php53-odbc                                                                 20/21
  Installing     : php53-mbstring                                                             21/21

Installed:
  php53.i386 0:5.3.3-13.el5_8                       php53-bcmath.i386 0:5.3.3-13.el5_8
  php53-cli.i386 0:5.3.3-13.el5_8                   php53-common.i386 0:5.3.3-13.el5_8
  php53-dba.i386 0:5.3.3-13.el5_8                   php53-devel.i386 0:5.3.3-13.el5_8
  php53-gd.i386 0:5.3.3-13.el5_8                    php53-imap.i386 0:5.3.3-13.el5_8
  php53-intl.i386 0:5.3.3-13.el5_8                  php53-ldap.i386 0:5.3.3-13.el5_8
  php53-mbstring.i386 0:5.3.3-13.el5_8              php53-mysql.i386 0:5.3.3-13.el5_8
  php53-odbc.i386 0:5.3.3-13.el5_8                  php53-pdo.i386 0:5.3.3-13.el5_8
  php53-pgsql.i386 0:5.3.3-13.el5_8                 php53-process.i386 0:5.3.3-13.el5_8
  php53-pspell.i386 0:5.3.3-13.el5_8                php53-snmp.i386 0:5.3.3-13.el5_8
  php53-soap.i386 0:5.3.3-13.el5_8                  php53-xml.i386 0:5.3.3-13.el5_8
  php53-xmlrpc.i386 0:5.3.3-13.el5_8

Complete!

How to check php version :

[root@centos59 ~]# php -v
PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:37)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

How to check installed php packages :

[root@centos59 ~]# rpm -qa | grep php*
php53-5.3.3-13.el5_8
php53-soap-5.3.3-13.el5_8
php53-xmlrpc-5.3.3-13.el5_8
php53-pspell-5.3.3-13.el5_8
php53-odbc-5.3.3-13.el5_8
php53-common-5.3.3-13.el5_8
php53-cli-5.3.3-13.el5_8
php53-ldap-5.3.3-13.el5_8
php53-process-5.3.3-13.el5_8
php53-intl-5.3.3-13.el5_8
php53-devel-5.3.3-13.el5_8
php53-imap-5.3.3-13.el5_8
php53-dba-5.3.3-13.el5_8
php53-bcmath-5.3.3-13.el5_8
php53-snmp-5.3.3-13.el5_8
php53-mbstring-5.3.3-13.el5_8
php53-pdo-5.3.3-13.el5_8
php53-mysql-5.3.3-13.el5_8
php53-pgsql-5.3.3-13.el5_8
php53-gd-5.3.3-13.el5_8
php53-xml-5.3.3-13.el5_8

Work around for error “php53-odbc64 conflicts with php53-odbc”

Question :
When i try to run “yum install php53*”, or “yum install php” to install php package on CentOS5.9, i get the following error :

..
..
..
  --> php53-odbc64 conflicts with php53-odbc
Error: php53-odbc64 conflicts with php53-odbc
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
..
..

Example :

[root@centos59 ~]# yum install php53*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nus.edu.sg
 * extras: mirror.nus.edu.sg
 * updates: mirror.nus.edu.sg
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-bcmath.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-cli.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-common.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-dba.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-devel.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-gd.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-imap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-intl.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-ldap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mbstring.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mysql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-odbc.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-odbc64.i386 0:5.3.3-2.el5 set to be updated
--> Processing Dependency: libodbc.so.2 for package: php53-odbc64
---> Package php53-pdo.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pgsql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-process.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pspell.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-snmp.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-soap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xml.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xmlrpc.i386 0:5.3.3-13.el5_8 set to be updated
--> Running transaction check
---> Package unixODBC64-libs.i386 0:2.2.14-3.el5 set to be updated
--> Processing Dependency: libltdl.so.3 for package: unixODBC64-libs
--> Running transaction check
---> Package libtool-ltdl.i386 0:1.5.22-7.el5_4 set to be updated
--> Processing Conflict: php53-odbc64 conflicts php53-odbc
--> Finished Dependency Resolution
php53-odbc64-5.3.3-2.el5.i386 from base has depsolving problems
  --> php53-odbc64 conflicts with php53-odbc
Error: php53-odbc64 conflicts with php53-odbc
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

Solution :
Anyway, I’ve got the workaround for this issue as mentioned in the log above.

[root@centos59 ~]# yum install php53* --skip-broken

How to Install php-mcrypt on CentOS 6.3

mcrypt exension for PHP is necessary if we want to use cookie based authentication with phpymyadmin. In default CentOS 6.3 yum repository or in CentOS 6.3 installation CD/DVD, php-mcrypt exension are not included. To install php-mcrypt on CentOS 6.3, we have to use third party yum repository. Follow this steps :

1. Download epel repository :

[root@centos62 ~]# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
[root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6

2. Install epel repository :

[root@centos62 ~]# rpm --import RPM-GPG-KEY-EPEL-6
[root@centos62 ~]# rpm -i epel-release-6-7.noarch.rpm

3. Simply run the following command to install php-mcrypt :

[root@centos63 ~]# yum install php-mcrypt -y
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirror1.ku.ac.th
 * epel: mirrors.ispros.com.bd
 * extras: mirror.issp.co.th
 * updates: mirror1.ku.ac.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.i686 0:5.3.3-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch                Version                    Repository           Size
====================================================================================================
Installing:
 php-mcrypt                i686                5.3.3-1.el6                epel                 18 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 18 k
Installed size: 38 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 18 k
php-mcrypt-5.3.3-1.el6.i686.rpm                                              |  18 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-mcrypt-5.3.3-1.el6.i686                                                      1/1
  Verifying  : php-mcrypt-5.3.3-1.el6.i686                                                      1/1

Installed:
  php-mcrypt.i686 0:5.3.3-1.el6

Complete!