Tag: PHP-FPM

Installing PHP for Nginx on Ubuntu 18.04

Installing PHP for Nginx on Ubuntu 18.04

In this guide we will install and configure PHP to work with Nginx on Ubuntu 18.04 LTS (Bionic Beaver). Unlike Apache, Nginx does not contain native PHP processing. For that we have to install PHP-FPM (FastCGI Process Manager). FPM is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites.

1. Install PHP-FPM Let’s begin by updating the package lists and installing PHP-FPM on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you get the latest version and dependencies for PHP-FPM. The second command will then download and install PHP-FPM. Press y and ENTER when asked to…

Continue reading Installing PHP for Nginx on Ubuntu 18.04

Guide: Installing PHP for Nginx (Ubuntu 16.04 / 17.10)

In this guide we will install and configure PHP-FPM to work with Nginx. Unlike Apache, Nginx does not contain native PHP processing. For that we have to install PHP-FPM (FastCGI Process Manager). FPM is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites. 1. Install PHP-FPM Let’s begin by installing PHP-FPM.…

Continue reading Guide: Installing PHP for Nginx (Ubuntu 16.04 / 17.10)

Nginx Default Config File for PHP-FPM

Here is the default Nginx config file with alterations to work with PHP-FPM. You can copy and paste this into your config file, you just need to change the line YOUR_DOMAIN_OR_IP_HERE to your own domain or IP address. These are the changes made to the default Nginx configuration file to work with PHP-FPM. Add index.php…

Continue reading Nginx Default Config File for PHP-FPM

WordPress “HTTP error” on large image file upload

I ran into a problem with WordPress on my DigitalOcean droplet recently. When uploading files larger than 10MB, WordPress would return a HTTP Error and fail to generate the thumbnail, although it did actually upload the file. Checking the Nginx error log I saw: /var/log/nginx/error.log 2017/05/05 23:11:48 [error] 2755#2755: *5 recv() failed (104: Connection reset…

Continue reading WordPress “HTTP error” on large image file upload

How to Restart PHP-FPM service and reload config

To restart the PHP-FPM service and reload the configuration file, firstly check which version of PHP you are running: php -v PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies Above we can see…

Continue reading How to Restart PHP-FPM service and reload config