Downloading and Installing PHP on macOS

This section provides a tutorial example on how to download and install the PHP engine on macOS computers.

The PHP engine is pre-installed on macOS computers. There is no need to run any command to download and install it.

For example, PHP 5.6 is available on my macOS 10.12 computer by default:

herong$ php -v 

PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Table of Contents

 About This Book

Introduction and Installation of PHP

 What Is PHP

 Downloading and Installing PHP on Windows

 Downloading and Installing PHP on Linux

Downloading and Installing PHP on macOS

 "php -help" - Command Line Options

 "php -m" - Built-in Modules

 "php -i" - PHP Engine Information

 php.ini - PHP Runtime Configuration

 Hello.php - My First PHP Script

 "php -a" - PHP Interactive Shell

 Downloading and Installing PHP Documentation

 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

 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

 Archived Tutorials

 References

 Full Version in PDF/EPUB