Upload Progress with PHP 7.1 and NGINX

While working on a Drupal 8 project served by NGINX and PHP-FPM, the status report looked great aside from UPLOAD PROGRESS at the bottom:

Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library.

As of Drupal 8.3.5, Drupal will complain until you install that PECL library, even if you’re using the NGINX Upload Progress module. The current php-uploadprogress package from Ondřej Surý’s excellent PPA doesn’t currently install uploadprogress.ini into /etc/php/7.1/mods_available/, but it can be used anyway or the module can be compiled from source.

If using the PPA:
sudo apt install php-uploadprogress
sudo ln -s /etc/php/7.0/mods-available/uploadprogress.ini /etc/php/7.1/fpm/conf.d/20-uploadprogress.ini

To compile the module from source:

git clone https://github.com/Jan-E/uploadprogress.git && cd uploadprogress
sudo make install

Then you can create the configuration file for PHP 7.1. Here
echo 'extension=uploadprogress.so' | sudo tee -a /etc/php/7.1/mods-available/uploadprogress.ini
sudo ln -s /etc/php/7.1/mods-available/uploadprogress.ini /etc/php/7.1/fpm/conf.d/20-uploadprogress.ini
sudo service php7.1-fpm restart

Visiting the Drupal status report at https://example.com/admin/reports/status UPLOAD PROGRESS should show.
Enabled (PECL uploadprogress).

Leave a Reply

Your email address will not be published. Required fields are marked *