Magento 2 : 500 Error internal server

by H_Parekh   Last Updated January 29, 2018 14:09 PM

I upload the data local to server . I changed env.php file and also change core_config_data table but when I run url on server it gives me 500 server error. while on local its run perfectly. can any one help me?

Error Like Below:

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Can't create directory /var/www/html/magento2/var/generation/Magento/Framework/App/ResourceConnection/. in /var/www/html/magento2/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /var/www/html/magento2/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #2 [internal function]: spl_autoload_call('Magento\\Framewo...') #3 /var/www/html/magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...') #4 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #5 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runt in /var/www/html/magento2/vendor/magento/framework/Code/Generator.php on line 103

I am using magento version: 2.0.2

Tags : magento-2.0 500


Answers 2


Run below command and check

rm -rf var/page_cache var/cache var/composer_home var/generation var/di var/view_preprocessed
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento indexer:clean

Give permission to var folder : Magento 2 folder/file permissions

Suresh Chikani
Suresh Chikani
January 29, 2018 13:31 PM

find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
A.Maksymiuk
A.Maksymiuk
January 29, 2018 13:47 PM

Related Questions



Magento 2 Checkouts page customization

Updated May 21, 2017 16:09 PM



Shopping cart price rule shipping issue

Updated May 16, 2018 16:09 PM