skip to Main Content

when I trying to migrate something I get this error:

**************************************
*     Application In Production!     *
**************************************

Do you really wish to run this command?
Command Cancelled!

Im running a centOS 6.5 server without Plesk 12
Is there anyway to figure out what the error is or how to solve it?

Thanks

5

Answers


  1. Change your environment first from production to local . /bootstrap/start.php somewhere line no 26

    $env = $app->detectEnvironment(array(
        // find your machine name and replace mine 
        'local' => array('hassanjamal.local'),
    ));
    
    Login or Signup to reply.
  2. Simple,

    $env = $app->detectEnvironment(function()
    {
       return 'development';
    });
    

    Good luck!

    Login or Signup to reply.
  3. I’ve just bumped into this problem as well. If you don’t want to reconfigure your app (which is probably a good idea) hit ‘Y’ and then enter instead of just enter. It will go on even in production setting.

    Login or Signup to reply.
  4. A bit late for answer but just for info purpose you can use php artisan migrate --force to avoid it OR in laravel 5.2 they are using a key env in config/app.php configure it to avoid this prompt
    reference https://github.com/laravel/laravel/blob/master/config/app.php

    Login or Signup to reply.
  5. Just use –force flag in production:

    php artisan migrate --force
    

    https://laravel.com/docs/6.x/migrations#running-migrations

    Forcing Migrations To Run In Production

    Some migration operations are destructive, which means they may cause
    you to lose data. In order to protect you from running these commands
    against your production database, you will be prompted for
    confirmation before the commands are executed. To force the commands
    to run without a prompt, use the –force flag.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search