I need to install module pf magento 2 in hosting. I'm trying to connect host with port 21 using putty but not success. I need one other way, please help me.
2 Answers
I think system() function will be your friend, if you don't have permission of CLI.
To use this function , just simple create new file in your root server(Let's call it custom.php
), then write below code in this file
system('php bin/magento cache:status');
// you can change it to your command
And run this script with http://your base url/custom.php
It will gives you resulted output.
You have also second option if you run magento2 command without CLI , but it doesn't gives you any message(I mean success or fail), but you can use if you don't have any option.
For that you have to create a new file(Let's call it custom1.php
), and write below code in your file.
<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$k[0]='bin/magento';
$k[1]='cache:status'; // write your proper command like setup:upgrade,cache:enable etc...
$_SERVER['argv']=$k;
try {
$handler = new \Magento\Framework\App\ErrorHandler();
set_error_handler([$handler, 'handler']);
$application = new Magento\Framework\Console\Cli('Magento CLI');
$application->run();
} catch (\Exception $e) {
while ($e) {
echo $e->getMessage();
echo $e->getTraceAsString();
echo "\n\n";
$e = $e->getPrevious();
}
}
And run this script with http://your base url/custom1.php
I know this is very dirty way, but you can use if you want.
-
could you please check this stackoverflow.com/questions/62694678/… Jul 6, 2020 at 7:16
-
You can install Magento 2 extension manually
- Download the extension
- Unzip the file in a temporary directory
- Upload it to your Magento installation root directory
- Disable the cache under System > Cache Management
Edit app/etc/config.php
file and three line code:
‘Ves_All’ => 1,
‘Ves_Megamenu’ => 1,
‘Ves_Setup’ => 1,
- Now Disable the cache under System > Cache Management
- After opening Stores > Configuration > Advanced > Advanced, the module will be shown in the admin panel.
You can see this article as reference
http://docs.magento.com/marketplace/user_guide/quick-tour/install-extension.html