I just installed EE on my Ubuntu VPS. As the installation flags I chose --php7 --letsencrypt and redis cache ( can't remember the flag. Upon completion I found that EE installed Wordpress on PHP 7.0.~. Meanwhile the EE stack runs on PHP 5~

I successfully installed PHP 7.2 onto my system Wordpress was still running on PHP 7.0. I verified this by creating the php info file and running the "ee stack info" cmd line.

I knew something was wrong here. Since this is the first VPS I am working with, I really don't know much about it. Upon running the following command I got the output below. I want to use PHP 7.2 on Wordpress and I am aware of the incompatibilities. Any help?

To understand what is happening and why your current WordPress keeps using php7.0-fpm, you may want to take a look in these config files. Let's follow the trail starting with the main site config:

1. /etc/nginx/sites-available/example.com

You'll notice a bunch of includes at the end, pointing at config files among which there are some with php7 in their name. If you used the --wpredis flag, the first one will be redis-php7.conf, so let's move over to hat one.

Hope that makes it a bit clearer on how this all fits together. Your server may be running many php-fpm (or other) processes at the same time (in fact, it should be running both 5.6 and 7.0 by default with easy engine) one site will still use only one of them. It can use a second as fallback (common in the early days of php7 and hhvm where 5.6 was used to catch failing processes) but even so, your site is bound to specific versions by the nginx config.

So to make it all switch to php 7.2, first make sure php7.2-fpm is installed and then open /etc/php/7.0/fpm/pool.d/www.conf to find out on what server/port or socket that process is listening. Let's say it's something like listen = /run/php7.2-fpm.sock

Now the easiest will be to modify the upstream php7 block in upstream.conf but be aware this can be overwritten on future easyengine updates. Also, if you're running more than one site, this will make all sites using the php7 upstream block to switch to PHP7.2 !!