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 7.3

 PHP Script File Syntax

 PHP Data Types and Data Literals

 Variables, References, and Constants

 Expressions, Operations and Type Conversions

 Conditional Statements - "if" and "switch"

 Loop Statements - "while", "for", and "do ... while"

 Function Declaration, Arguments, and Return Values

 Arrays - Ordered Maps

 Interface with Operating System

 Introduction of Class and Object

 Integrating PHP with Apache Web Server

 Retrieving Information from HTTP Requests

 Creating and Managing Sessions in PHP Scripts

 Sending and Receiving Cookies in PHP Scripts

 Controlling HTTP Response Header Lines in PHP Scripts

 Managing File Upload

 MySQL Server Connection and Access Functions

 Functions to Manage Directories, Files and Images

 SOAP Extension Function and Calling Web Services

 SOAP Server Functions and Examples

 Localization Overview of Web Applications

 Using Non-ASCII Characters in HTML Documents

 Using Non-ASCII Characters as PHP Script String Literals

 Receiving Non-ASCII Characters from Input Forms

 "mbstring" Extension and Non-ASCII Encoding Management

 Managing Non-ASCII Character Strings with MySQL Servers

 Parsing and Managing HTML Documents

 Configuring and Sending out Emails

 Image and Picture Processing

 Managing ZIP Archive Files

 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

 Outdated Tutorials

 References

 Full Version in PDF/EPUB