Magento -site not opening after CLI -installation

So this solved this for me, thank you @Steve Johnson.

Edited php.ini file:

session.save_handler = files
;session.save_path = "/tmp"

-->

session.save_handler = files
session.save_path = "var/www/magento2/var/session"

Edited php.env file:

'session' =>
     array (
    'save' => 'files',
   ),

-->

'session' =>
     array (
    'save' => 'files',
    'save_path' => '/var/www/magento2/var/session',
   ),

Thank you so much this also helped me fix my problem...

I had used the free Softaculous Installer via my cPanel to install Magento v2.2.6 It said the installation was successful but when trying to access Magento I got the error "There has been an error processing your request".

I found the detailed error messages in the ./var/reports directory and they looked like this:

Warning: SessionHandler::read(): open(195.201.9.76:11211/sess_0622981ed0e8a3aaf857122afbd443a7, O_RDWR) failed: No such file or directory (2) in //public_html//vendor/magento/framework/Session/SaveHandler/Native.php on line 22

So my session directory was in a slightly different place from the above solution...I added a save_path entry into my ./app/etc/env.php file....in the session section like this:

'session' =>
     array (
    'save' => 'files',
    'save_path' => './vendor/magento/framework/Session'
   ),

And then it worked fine!