PHP Version Pre-Installed on CentOS 6

This section provides notes to verify PHP version supported on CentOS 6.0 and run a simple PHP interactive scripting session.

Older versions of CentOS also comes with PHP engine pre-installed. Here is what I did to verify the PHP version and program file locations on my CentOS 6 system:

1. Run "php -version" to see the PHP version number:

herong$ php -version

PHP 5.3.3 (cli) (built: Mar 22 2017 12:17:33)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

2. Run PHP scripts interactively:

herong$ php -a
Interactive shell

php > print "Hello world!\n";
Hello world!

php > exit

3. Verify PHP program file locations:

herong$ which php
/usr/bin/php

4. Check to see if there any updates available:

herong$ yum info php

Installed Packages
Name        : php
Arch        : i686
Version     : 5.3.3
Release     : 49.el6
Size        : 3.3 M
Repo        : installed
From repo   : base
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to
              ...

Available Packages
Name        : php
Arch        : i686
Version     : 5.3.3
Release     : 50.el6_10
Size        : 1.1 M
Repo        : updates
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to
              ...

So there is a minor update available. I can install it with the "yum install php" command if I want to.

Table of Contents

 About This Book

 Introduction and Installation of PHP

 Managing PHP Engine and Modules on macOS

Managing PHP Engine and Modules on CentOS

 PHP Version Pre-Installed on CentOS

 Install PHP Extensions on CentOS

PHP Version Pre-Installed on CentOS 6

 Use PHP Composer on CentOS Computers

 cURL Module - Client for URL

 DOM Module - Parsing HTML Documents

 GD Module - Manipulating Images and Pictures

 MySQLi Module - Accessing MySQL Server

 OpenSSL Module - Cryptography and SSL/TLS Toolkit

 PCRE Module - Perl Compatible Regular Expressions

 SOAP Module - Creating and Calling Web Services

 SOAP Module - Server Functions and Examples

 Zip Module - Managing ZIP Archive Files

 References

 Full Version in PDF/EPUB