O'Reilly logo

Modern PHP by Josh Lockhart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Installing PHP

Linux

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 Server or 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.

Package Managers

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.

Warning

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 system root user or a user with sudo power. This is required to install software with a Linux package manager.

Ubuntu 14.04 LTS

Ubuntu does not provide the latest PHP version in its default software repositories. We’ll need to add a community-maintained ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required