I am converting custom php of magento 1 into magento 2
this is the error. Fatal error: Uncaught MagentoFrameworkExceptionLocalizedException: Area code is not set in /var/www/html/magento22/vendor/magento/framework/App/State.php:152 Stack trace: #0 /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php(173): MagentoFrameworkAppState->getAreaCode() #1 /var/www/html/magento22/generated/code/Magento/Framework/Session/Generic/Interceptor.php(50): MagentoFrameworkSessionSessionManager->start() #2 /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php(130): MagentoFrameworkSessionGenericInterceptor->start() #3 /var/www/html/magento22/generated/code/Magento/Framework/Session/Generic/Interceptor.php(14): MagentoFrameworkSessionSessionManager->__construct(Object(MagentoFrameworkAppRequestHttp), Object(MagentoFrameworkSessionSidResolverProxy), Object(MagentoFrameworkSessionConfig), Object(MagentoFrameworkSessionSaveHandler), Object(MagentoFrameworkSessionValidator), Object(MagentoFrameworkSessionStorage), Object(MagentoFramewor in /var/www/html/magento22/vendor/magento/framework/Session/SessionManager.php on line 175…