PHP Tutorials - Herong's Tutorial Examples - v5.18, by Herong Yang
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
Introduction and Installation of PHP
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
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
Functions to Manage Directories, Files and Images
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
Configuring and Sending Out Emails
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