Linux is my favorite development environment. I own a Macbook Pro with
OS X, but my development happens in a Linux virtual machine. PHP is easy
to install on Linux with a package manager such as
aptitude on Ubuntu
yum on CentOS.
For now, we’re concerned only with PHP for command-line usage. We discuss how to setup PHP-FPM and the nginx web server in Chapter 7.
Most Linux distributions provide their own package manager. For
example, Ubuntu uses the
aptitude package manager. CentOS and Red Hat
Enterprise Linux (RHEL) use the
yum package manager. Package managers
are the simplest way to find, install, update, and remove software on
our Linux operating system.
Sometimes Linux package managers install out-of-date software. For example, Ubuntu 14.04 LTS provides PHP 5.5.9; this is already behind the latest release—PHP 5.6.3 (as of December 2014).
Fortunately, we can supplement our Linux package manager’s default
software sources with third-party repositories that contain more
up-to-date, community-maintained software packages. We’ll use a custom
software repository for both Ubuntu and CentOS to install the most
recent PHP version. Before we go any further, make sure you are the
root user or a user with
sudo power. This is required to
install software with a Linux package manager.
Ubuntu does not provide the latest PHP version in its default software repositories. We’ll need to add a community-maintained ...