0

I have installed a new module and added modulevendor_modulename=>1 in the config.php file, but this gave me an error of:

a:4:{i:0;s:263:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. 
The following modules are outdated:...

I don't have ssh access, is there any to register/run this new module in my remote server?

1

Refer to my answer in the below post

Magento 2: programmatically run setup upgrade

<?php
    use Magento\Framework\App\Bootstrap;
    include('../app/bootstrap.php');
    $bootstrap = Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();


    $modules = array('VENDORNAME_MODULENAME');
    try{
        /* Code to enable a module [ php bin/magento module:enable VENDORNAME_MODULENAME ] */
        $moduleStatus = $objectManager->create('Magento\Framework\Module\Status')->setIsEnabled(true,$modules);


        /* Code to run setup upgrade [ php bin/magento setup:upgrade ] */
        $installerFactory = $objectManager->create('Magento\Setup\Test\Unit\Console\Command\UpgradeCommandTest')->testExecute();


        /* Code to clean cache [ php bin/magento:cache:clean ] */
        try{
            $_cacheTypeList = $objectManager->create('Magento\Framework\App\Cache\TypeListInterface');
            $_cacheFrontendPool = $objectManager->create('Magento\Framework\App\Cache\Frontend\Pool');
            $types = array('config','layout','block_html','collections','reflection','db_ddl','eav','config_integration','config_integration_api','full_page','translate','config_webservice');
            foreach ($types as $type) {
                $_cacheTypeList->cleanType($type);
            }
            foreach ($_cacheFrontendPool as $cacheFrontend) {
                $cacheFrontend->getBackend()->clean();
            }
        }catch(Exception $e){
            echo $msg = 'Error during cache clean: '.$e->getMessage();die();
        }   
    }catch(Exception $e){
        echo $msg = 'Error during module enabling : '.$e->getMessage();die();
    }
0

You should use System Upgrade tools. See http://devdocs.magento.com/guides/v2.1/comp-mgr/upgrader/upgrade-start.html for more details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.