Upgrade PHP 5.6 to PHP 7 on Nginx / Debian Jessie

With recent updates, WordPress has increased it server requirement from PHP 5.6 to PHP 7. I think it is the best time to upgrade PHP to follow the requirement. FYI, Most of my servers are running based on Debian Jessie.

Uninstall old PHP

If your server freshly installed, jump to next step.

I prefer to uninstall old PHP as most of my sites are running WordPress.

List all PHP packages installed:

you will see the list of packages related to PHP, if you sure to do this let’s go on to removal process:

Install PHP7

Add repository:

Install GnuPG key:

Update local package:

Install PHP7:

Install PHP7-MySQL:

Configuring Nginx Server Block

Next part is to configuring Nginx server block, the config file(s) location may vary depending on admin’s preferences.

Comment old config or delete it, add new path module:

Restart Nginx:

Start PHP7-FPM:


or, add this to a blank .php file:

then access it using your web browser. And try to run your WordPress website now.


I feel that sites are under PHP 7 significantly runs faster. I didn’t do a measured test but, here the benchmark PHP 7 vs previous versions.


You might need to install php-gd to enable image resizing for WordPress:

These PHP module packages also required:

I updated the PHP 7.0 to PHP 7.2

How To, Linux, PHP, Software, Update

Any idea? Fill the comment below

This site uses Akismet to reduce spam. Learn how your comment data is processed.