yii 500 ?? ??? ??
yii2 ??? ?? 500 ??
?????? ?? ?? ????? ????? ?? ??? ? ? ??? ???? ??? 500 ??? ??? ????. , ?? ??? ??? ?? ???? ?????? ???.
?? ??: yii ?????
? ???? ?? ? ??? ?? ???? ?????? ??? ?? ?????: http://tech. .com/2015/12/12/yii2-0 ?????? ?? ? ?? ?? ????/
?? ?? ?? ??? ??? ???? ?? ?? yiibaseErrorHandler? ???? ??? ??? renderException? ???? ????? ?? ? ?? $config?? ???? errorHandler? ??? ?????
1. ErrorHandler? ??? ? yiibaseErrorHandler ?? ???? ??? ?? ? ?? ???
<?php namespace common\component\exception; /** * User: szliugx@gmail.com * Date: 2016/9/20 * Time: 14:24 */ use yii; use yii\base\ErrorHandler as BaseErrorHandler; use common\component\earlywarning\EarlyWarning; class ErrorHandler extends BaseErrorHandler { public $errorView = '@app/views/errorHandler/error.php'; public function renderException($exception) { if(Yii::$app->request->getIsAjax()){ exit( json_encode( array('code' =>$exception->getCode(),'msg' =>$exception->getMessage()) )); }else{ //將500的代碼,發(fā)送監(jiān)控預(yù)警 if(!empty($exception->getCode()) && $exception->getCode() ==8){ $params = []; $params['projectName'] = "oct-youban"; $params['level'] = 5; $params['title'] = "500:".$exception->getMessage(); $params['value'] = $exception->getCode(); $params['message'] = $exception->getFile().":".$exception->getLine(); $params['bizcode'] = 8; $params['subcode'] = 8001; EarlyWarning::WarninApi($params); } echo Yii::$app->getView()->renderFile($this->errorView,['exception' => $exception,],$this); } } }
?? ?? ???? ?????.
2. error.php
<?php /** * User: szliugx@gmail.com * Date: 2016/9/20 * Time: 15:23 */ ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Pragma" content="no-cache"> <title><?php if(!empty($exception->getCode())&&($exception->getCode() == 8)){echo "出錯啦";}else{ echo $exception->getMessage();}?></title> <link href="/css/error.css" rel="stylesheet" 0="frontend\assets\AppAsset"> </head> <body> <div> <div class="status-icon icon-desk"></div> <div> <p><?php if(!empty($exception->getCode())&&($exception->getCode() == 8)){echo "出錯啦";}else{ echo $exception->getMessage();}?></p> </div> </div> </body> </html>
3. ?????? ?? ?? ??: @app/config/main.php
'errorHandler' => [ //'errorAction' => 'site/error', 'class' => 'common\component\exception\ErrorHandler', ],
??? ??? ????? ? ? ?? ?????.
500 ??. ???:
404 ?? ???:
? ??? yii 500 ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

?? ??? ???? ????, ????, ???? ??? ?? ??? ?? ??? ??? ?????. ??? ??? ??? ??? ??? ?? ???? ??? ?? ??? ??? ?? ??? ?? ??. ??? ?? ??? ??? ?? ??, ?? ? TV ?? ??, ????? ??? ? ?? ???? ?? ?????. ????? ??? ????? ??? ?????? ???? ?? ?? ??? ?????. ?? ?? ??? PHP? Yii2, Ph? ?? ??? PHP ????? ? ?? ???? ?????.

Yii ?????? ? ?????? ?? ????? ????? ?? ??? ??? ?? ??? ???? ?? ?? PHP ? ?????? ????????. ??? ??? ??? ?? ?? ? ?????. Yii ???????? SQL? ??? ??? ???? ??????? ????? ???? ????? ???? ??? ? ????. Yii ?????? ?? ???? ?? ActiveRecord ??, QueryBuilder ??, ?? ?? ? ?? SQL ?? ??? ?????.

? ??????? ?? ??? ?? ???? ?? ???? ?? ?????? ??? ? ?? ? ?? ???? ?? ?????. Symfony? Yii2? ? ?? ?? ?? PHP ????????. ? ? ??? ??? ??? ??? ??? ??? ? ??????? ???? ?? ?? ?? ?????? ? ?????? ???? ? ?? ??? ?? ? ??? Symphony? Yii2? ?? ??? ???????. ?? ?? Symphony? PHP? ??? ?? ?? ? ?????? ??????? ??? ???? ???.

???? ??? ??? ????? ????? ??? ??? ?? ??? ??? ?? ? ?? ?????. ??? ???? ???? ?? ???? ?? ???? ???? ?? ?? ?????. PHP ????? Yii? ???? ??? ? ??????? ??? ???? ? ??? ?? ??? ????????. ??? Yii ?????? ???? ???? ???? ?? ???? ???? ??? ?????. ?????? ?? ?? Yii ??????? ?????? ??? ?? ??? ?????. ??? ?? ????? ?? ???? ??? ???? ???

Laravel? YII? ?? ???? ?? ??, ??? ?? ? ?? ???????. 1. Laravel? ??? ???? ???? ????? Eloquentorm ? Artisan ??? ?? ??? ??? ???? ?? ?? ? ????? ?????. 2.YII? ??? ???? ????, ? ?? ??????? ????, ???? Activerecord ? ?? ???? ????? ??? ?? ??? ????.

Docker? ???? YII ??????? ??????? ???? ???? ??? ?????. 1. Dockerfile? ???? ??? ?? ????? ?????. 2. DockerCompose? ???? YII ?? ???? ? MySQL ??????? ??????. 3. ??? ?? ? ??? ???????. ???? ?? ?? ???? ??? ????? ??? ??? ??? ???? ?? Dockerfile? ?? ??? ?? ??? ???? ?? ?????.

???? ??? ???? ?? API? ??? ?????? ?? ???? ???? ??? ??? ?????. ??? ?? ??? ?? ????? ???? API ?????? ???? ?? ?? ? ????? ????. API ?????? ??? ? Yii2? Symfony? ???? ???? ?? ?? ? ?? ?????. ???? API ???? ?? ?? ? ?????? ? ????? ? ? ?????? ???? ? ?? ??? ?????. 1. ?? ?? Yii2? Symfony? ??? ??? ? ?? ?? ?? ??? ?? ??? PHP ????????.

"Yii? ??????"?? ???? Yii? ??? ???? 2014? 10?? ??? Yii 2.0? ??? ??? ???? ???? ?? ????? Yii ????? ??? ?????. ?> ?? Yii2 ????? ?????? Yii2PHP ?????? ???? ??? ????? ???????. ?? ??????? Yii? ?? ??? ???? ?? ??? ???? ??? ???????. ???? cron ???? ? ??? ?? URL? wget? ???? ????? ??? ??????. ?? ?? ?? ??? ???? ?? ?? ??? ?????. Security for Startup ????? ??? ???? ? ?? ??? ???? ?? ?? ?? ???? ???? ?????.
