I need some help, my websites are showing the key after the url. So i thought it is still in developer mode and need to be turned into production mode.

I checked the magento file in folder bin, but can't find a thing. Please check:

#!/usr/bin/env php
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
if (PHP_SAPI !== 'cli') {
echo 'bin/magento must be run as a CLI application';
try {
require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
echo 'Autoload error: ' . $e->getMessage();
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();
  • What do you mean by "showing the key after the url"? – Ryan Hoerr Oct 17 '18 at 17:29

You have tried to check a wrong file. The Magento mode is set in the app/etc/env.php file.

There are two ways to set the production mode for the website:

Method 1: Open the app/etc/env.php file and change:

'MAGE_MODE' => 'developer',


'MAGE_MODE' => 'production',

Method 2: Open the terminal and change directory to the document root of your Magento folder. Then run the following command:

php bin/magento deploy:mode:set production
|improve this answer|||||
  • Thanks, I see that it is in production mode – user47444 Oct 21 '18 at 10:24

It's normal that bin/magento is empty. You get an error when you run the deploy:mode:set command?

Switch to production mode:

rm -rf /website-root/generated/metadata/* /website-root/generated/code/*


php bin/magento deploy:mode:set production

Hide URL key:

  php bin/magento config:set admin/security/use_form_key 0
|improve this answer|||||
  • I there a file where i can hide the URL key? because i don't know where and how to run the command. – user47444 Oct 21 '18 at 10:26

Your Answer

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