Yii Framework Forum: DEBUG Mode For Live - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DEBUG Mode For Live Why bebug mode does not show up when live Rate Topic: -----

#1 User is offline   auzadventure 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 20-August 15
  • Location:Singapore

Posted 16 August 2017 - 11:08 PM

Just a note.

When you deploy 2.0 to remote server. You need to set

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');


But the code only allows local host 127.0.0.1. Go to your app config page and add
the below line

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
		'allowedIPs'=> ['*']      <--------- or your IP for security
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
}




Questions are the Answer.

Wesvault - Premium Economy Software
Yii2 Framework Specialist
http://www.wesvault.com

Singapore
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,184
  • Joined: 17-January 09
  • Location:Russia

Posted 22 August 2017 - 02:55 AM

Note that in general it's a very bad idea to enable debug and development mode at production server.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
2

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 11 September 2017 - 01:54 AM

It is much better to use Docker/VirtualBox/Vagrant to replicate the remote server, if it is impossible to replicate the environment on your own machine.
Debugging a live server is not very smart, to put it mildly. :)
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users