My webserver host does not provide access to SSH.

I want to run commands like:

php bin/magento setup:static-content:deploy

I have tried to do this in the shell terminal using: - phpFileManager - eXtplorer But none of them seem to work.

When I run the command nothing happens, and there is no output to the console: Magento command no output

Can this even work in a shell, or do I need to have SSH access?


Try it :

How to install module magento 2 don't need run command line bin/magento setup:upgrade

This is not a good way but if you have not SSH then you can use it if you want.

  • Thanks for the suggestion, I will look into this and get back to you. – Jonas Jensen Aug 10 '16 at 11:16

Execute command localy and put genereated files from pub/* and var/* to server

  • Ok, I will try that. What about commands like "magento setup:upgrade" to update the database for modules? – Jonas Jensen Aug 9 '16 at 17:00
  • You can run this command in magento updater application – KAndy Aug 9 '16 at 19:50

Here is the perfect solution. Even if system() and shell_exec() and other commands are disabled from server due to security reasons, this script will help you to execute commands.

Note : It will not give any output but it will execute the command successfully.

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');
$k[1]='setup:upgrade'; // You can change command as you want like setup:static-content:deploy, cache:status etc.
try {
$handler = new \Magento\Framework\App\ErrorHandler();
set_error_handler([$handler, 'handler']);
$application = new Magento\Framework\Console\Cli('Magento CLI');
} catch (\Exception $e) {
while ($e) {
echo $e->getMessage();
echo $e->getTraceAsString();
echo "\n\n";
$e = $e->getPrevious();

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.