skip to Main Content

I need to install several extensions. I don’t have SSH to that host so I need to be able to do everything with FTP + magento 2 backend.

So far I’ve copied the extension files on the /app/ dir.

Looking at extension istructions i see this:

php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy

There is a way to accomplish this in another way? Installing extensions in Magento feels really cumbersome and awkward compared to other CMS like WordPress or Drupal.

Update
I found an article that suggests to do this:

Edit app/etc/config.php file and three line code:
‘Ves_All’ => 1,
‘Ves_Megamenu’ => 1,
‘Ves_Setup’ => 1,

But I have no clue what is that and I haven’t found so far any info about those options.

2

Answers


  1. Make a new php file Let say “updater.php” and paste following code in it (add php tags at start n end of file).

      system('php bin/magento setup:upgrade');
      system('php bin/magento cache:flush');
      system('php bin/magento setup:static-content:deploy');
    

    We are using system() function to run PHP SSH commands.

    Upload this file in your Web root and access it using

    http://yourdomain/updater.php

    You will see output of commands after few seconds

    Login or Signup to reply.
  2. If you can upload file to your server, you can use my file to run magento command line
    enter image description here
    Realy sorry!I cannot upload php file here. So you can down it on this page http://www.mageoneplus.com/how-to-run-magento-command-line-without-ssh-access.html

    <div class="mageoneplus">
        <div class="header"> Welcome to ssh command line</div>
        <div class="body">
            <?php 
                if(isset($_SERVER['ORIG_PATH_INFO'])){
                    $url = $_SERVER['ORIG_PATH_INFO'];
                }elseif(isset($_SERVER['PATH_INFO'])){
                    $url = $_SERVER['ORIG_PATH_INFO'];
                }
            ?>
            <form action="<?php echo $url; ?>" id="mageoneplus-ssh" method="post" >
                <div  class="run-ssh">Example: php bin/magento</div>
                <div class="input">
                    <?php
                        $value = "php bin/magento ";
                        if(isset($_POST["command"]) && $_POST["command"]){
                            $value = $_POST["command"];
                        }
                    ?>
                    <input type="text" style="width:600;"  name="command" id="command"  value="<?php echo $value ?>"  placeholder="Enter command line here..." />
                </div>
            </form> 
            <button type="submit" form="mageoneplus-ssh" value="Submit">Run</button>
            <div class="result">
                <?php
                    if(isset($_POST["command"]) && $_POST["command"]){
    
                        try{
                            $output = null;
                            set_time_limit(0);
                            $str = $_POST["command"];
                            exec($str, $output);
                ?>
    
                <h1>The result:</h1>
                    <ul class="result-text">
                        <?php
                            foreach($output as $op){
                        ?>
                            <li><?php echo $op; ?> </li>
                        <?php
                            }
                        ?>
                    </ul>
                <?php
    
                        } catch (Exception $e) {
                            echo 'you must <a href="https://www.google.com/search?q=enable+exec">enable exec</a>';
                        }
                    }           
                ?>
            </div>
        </div>
        <div class="author">
            <div>Written by <a href="http://mageoneplus.com">Louis Pham</a></div>
        </div>
    </div>
    <style>
        .mageoneplus{ padding:20px; }
        .header , .body ,.author{padding:10px 0px; }
        .run-ssh{ margin:10px 0px; }
        .result-text{ max-height: 400px;overflow-y: scroll;}
    </style>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search