
yii2
1에서 디버그를 활성화하는 방법 web/index.php 파일에 다음 두 줄의 코드를 추가합니다:
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev');
2 yii 구성 디렉터리에서 web.php 파일을 엽니다. 그리고 다음 구성을 찾으세요
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [ 'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['127.0.0.1', '我的IP'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['127.0.0.1', '我的IP'],
];
}자신의 IP를 추가하세요.
추천: "YII 튜토리얼"
위 내용은 yii2에서 디버깅을 활성화하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!