∟PHP Version Pre-Installed on CentOS

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

CentOS comes with PHP environment pre-installed. Here is what I did to verify the PHP version and program file locations:

1. Run "uname -mprsv" to confirm the Linux version. The output shows that I am running Linux 4 with CentOS 8 (el8):

herong$ uname -mprsv
Linux 4.18.0-147.el8.x86_64
   #1 SMP Wed Dec 4 21:51:45 UTC 2019 x86_64 x86_64

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

herong$ php -version

PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

3. Run PHP scripts interactively:

herong$ php -a
Interactive shell

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

php > exit

4. Verify PHP program file locations:

herong$ which php
/usr/bin/php

5. Verify PHP installation package information:

herong$ dnf info php
CentOS-8 - AppStream ...
CentOS-8 - Extras ...

Installed Packages
Name         : php
Version      : 7.2.11
Release      : 2.module_el8.1.0+209+03b9a8ff
Architecture : x86_64
Size         : 5.5 M
Source       : php-7.2.11-2.module_el8.1.0+209+03b9a8ff.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : PHP scripting language for creating dynamic web sites
URL          : http://www.php.net/
License      : PHP and Zend and BSD and MIT and ASL 1.0
Description  : PHP is an HTML-embedded scripting language. PHP attempts to make it
             : easy for developers to write dynamically generated web pages. PHP also
             : offers built-in database integration for several commercial and
             : non-commercial database management systems, so writing a
             : database-enabled webpage with PHP is fairly simple. The most common
             : use of PHP coding is probably as a replacement for CGI scripts.
             :
             : The php package contains the module (often referred to as mod_php)
             : which adds support for the PHP language to Apache HTTP Server.

Table of Contents

 About This Book

 Introduction and Installation of PHP

 Managing PHP Environment and Modules on macOS

►Managing PHP Environment 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

 Configuration and Modules

 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

 Index

 Full Version in PDF/EPUB