Need help? Chat now!
Search results for:
Table of Contents
PHP modules are extensions that can greatly extend the core functionality of PHP. These modules are compiled libraries that can help you utilize different methods to connect to other services without the need to rewrite these methods yourself each time you'd like to use them. By enabling these modules, your PHP code can have the capability and adaptability to interact with other services such as MySQL seamlessly. The focus of this article is to help show you how to install PHP modules quickly and easily. This article implies that you have already installed PHP on your Ubuntu 14.04 server. However, please review the following article: How to install PHP (Ubuntu 14.04) if you have not yet done so.
Before getting started, you'll need to log in to your server using SSH. If you're not familiar with how to do this, please take a moment and read through the following article: Connecting to Your Server via SSH. Once you have connected to your server via SSH, you can move on with the installation.
To install the software in Ubuntu, you'd generally use apt-get followed by the install option and finally the package name so that the full command would be something like apt-get install. Installing PHP modules is pretty much the same process, but what if you weren't sure what PHP modules are available? Simple, you'd use the apt-cache search command. For example, to search for PHP 5 modules, you'd use:
apt-cache search php5-
This would provide you with a list of available modules and a short description of each module. However, if you need additional information, you can either Google the module name or use the following command and syntax:
apt-cache show package-name
So if, for example, you wanted to see more information about php5-fpm, you'd use the following:
apt-cache show php5-fpm
Once you're ready to install a PHP module, you can do so using the following command. Again we will use php5-fpm as an example:
apt-get install php5-fpm
You can also install multiple modules or packages by placing a space between each separate module or package like so:
apt-get install php5-fpm php5-cli
The command above would install fpm and the cli package for PHP 5. Like most things, moderation is the key, and it is best only to install modules that you need. We hope that after reading this article, you now feel more comfortable installing PHP modules. If you're interested in testing your server's PHP processing, we have an article that you might enjoy that covers how to do just that: Create a PHP info page.
Written by Michael Brower / June 22, 2017