1

Magento 2 gives an 500 Error

in production mode it give below error :

it is just HTTP 500 Error,

In development mode it gives below error :

    Warning: SessionHandler::read():         open(/var/opt/remi/php70/lib/php/session/sess_v75jb3v5vag48tgpu0nhcp80c3,         O_RDWR) failed: Permission denied (13) in         /var/www/html/vendor/magento/framework/Session/SaveHandler.php on line 74
    #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/var/www/html/v...', 74, Array)
    #1 /var/www/html/vendor/magento/framework/Session/SaveHandler.php(74): SessionHandler->read('v75jb3v5vag48tg...')
    #2 [internal function]: Magento\Framework\Session\SaveHandler->read('v75jb3v5vag48tg...')
    #3 /var/www/html/vendor/magento/framework/Session/SessionManager.php(189): session_start()
    #4 /var/www/html/vendor/magento/framework/Session/SessionManager.php(130): Magento\Framework\Session\SessionManager->start()
    #5 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFact        ory.php(114): Magento\Framework\Session\SessionManager-        >__construct(Object(Magento\Framework\App\Request\Http),         Object(Magento\Framework\Session\SidResolver\Proxy),         Object(Magento\Framework\Session\Config),         Object(Magento\Framework\Session\SaveHandler),         Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage),         Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
    #6         /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
    #7 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
    #8 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
    #9 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'session', 'Magento\\Store\\A...')
    #10 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Store\\A...', Array, Array)
    #11 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...')
    #12 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...')
    #13 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'redirect', 'Magento\\Framewo...')
    #14 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
    #15 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
    #16 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
    #17 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'context', 'Magento\\Cms\\Con...')
    #18 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Cms\\Con...', Array, Array)
    #19 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Cms\\Con...', Array)
    #20 /var/www/html/vendor/magento/framework/App/ActionFactory.php(37): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Cms\\Con...')
    #21 /var/www/html/vendor/magento/framework/App/Router/Base.php(300): Magento\Framework\App\ActionFactory->create('Magento\\Cms\\Con...')
    #22 /var/www/html/vendor/magento/framework/App/Router/Base.php(161): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)
    #23 /var/www/html/vendor/magento/framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))
    #24 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
    #25 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
    #26 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
    #27 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'requestPreproce...')
    #28 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(89): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #29 [internal function]: Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
    #31 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
    #32 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #33 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #34 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
    #35 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
    #36 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #37 [internal function]: Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #38 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
    #39 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
    #40 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #41 [internal function]: Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #42 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
    #43 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
    #44 /var/www/html/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #45 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #46 /var/www/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #47 {main}

It's happende after:

    # /usr/bin/php70 -c /etc/opt/remi/php70/php.ini bin/magento setup:di:compile

Also before this command there was an Internal Magento Error while Im trying to enter to Admin Panel, after

  yum update 

Any help?