well it says that your di folder is not there in the error. delete the var folder and then run php bin/magento setup:di:compile
and make sure it creates a di folder inside var. Then run php bin/magento setup:upgrade
. Also check your database connection in app/etc/env.php
and the permissions on that file.
Look at these lines in env.php and make sure they are correct:
array (
'table_prefix' => '',
'connection' =>
array (
'default' =>
array (
'host' => 'localhost',
'dbname' => 'your_dbname',
'username' => 'your_user',
'password' => 'your_pass',
'active' => '1',
Also make sure your user has access to the database.
Update:
that means there still is an error with the di file. run these commands:
rm -rf var/di var/generation/ var/cache and var/page_cache
rm -rf pub/static/frontend pub/static/_requirejs/ pub/static/adminhtml
sudo chmod -R 777 var pub lib app/etc
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
As a sidenote, your env.php should look like this:
<?php
return array (
'backend' =>
array (
'frontName' => 'login',
),
'install' =>
array (
'date' => 'Mon, 14 Mar 2016 16:04:24 +0000',
),
'crypt' =>
array (
'key' => 'cc1482148f935ef000f4b0c4bc',
),
'session' =>
array (
'save' => 'files',
),
'db' =>
array (
'table_prefix' => '',
'connection' =>
array (
'default' =>
array (
'host' => 'localhost',
'dbname' => 'db',
'username' => 'user',
'password' => 'pass',
'active' => '1',
),
),
),
'resource' =>
array (
'default_setup' =>
array (
'connection' => 'default',
),
),
'x-frame-options' => 'SAMEORIGIN',
'MAGE_MODE' => 'developer',
'cache_types' =>
array (
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'eav' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'full_page' => 1,
'translate' => 1,
'config_webservice' => 1,
'compiled_config' => 1,
),
);