我有一个后台进程,当特定事件发生时发送电子邮件给我。它在大多数情况下(10次中有9次)是有效的,但有时我会收到以下错误消息:
PHP Warning 'yii\base\ErrorException' with message 'fwrite(): SSL: An established connection was aborted by the software in your host machine.'
in E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\
昨天,我把我的yii项目网站上传到了servobox的网站上。
我的index.php
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../hshome/paperchoicecomph/p/yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production
下面是我在前端SiteController中的actionLogin()函数。
public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this-
我有一个在Yii2高级模板的代码,这里我想为用户和管理员的后端的前端单一的登录页。一旦我已经从前端登录,然后,如果那是一个管理员,那么我想重定向到后台主页的登录,而不是登录在前端,也如果这是一个用户,然后我想重定向在前端主页。
在这里,我的问题是管理员用户,我已经重定向到后端索引页面,但我需要在后端再次登录。此外,如果我使用前台管理,该帐户仍然保留。
我的前台siteController.php:
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->
我找不到指定如何设置公共html目录的文档。我正在尝试将所有其他文件和文件夹保留在站点根目录中。因为有一个前端和后端的公共html文件夹,我不认为这是可能的。
我的网站:
/site/perl/
/site/www/ <-How do you get just the 2 public folders here?
/site/.ssh
Yii样板:
runpostdeploy
yiic
/backend/
- /config
- /www/index.php
/frontend/
- /config
- /www/index.php
/common/
/consol
作为标题,我将创建自定义控制器并在Yii 2中覆盖核心控制器,下面是我的代码。/create BaseController,我把这个文件放在根/组件中。
namespace yii\base;
use Yii;
class BaseController extends \Controller{
public function init() {
parent::init();
}
}
/* Extends BaseController.*/
namespace app\components;
use Yii;
class UsersController exte
我目前正在尝试用户运行操作来执行进程(特别是长请求),而不需要用户等待。因此,我遵循了的文档。它说下面应该是可行的。insert语句应该在操作仍在继续的情况下工作。
public function actionLongProcess(){
if(ERunActions::runBackground()){
$sql = <<<EOD
insert into public.test (value) VALUES ('hehe')
我安装了新的Yii高级框架。Nginx服务器。
下面的url工作正常:
我使用GII创建了新的CRUD并访问了:
它显示以下错误:
An Error occurred while handling another error:
exception 'yii\web\ForbiddenHttpException' with message 'You are not allowed to perform this action.' in /private/var/www/yii/advanced/vendor/yiisoft/yii2/filters/AccessC
我刚刚使用XAMPP for linux 7.0.23在Linux mint 18.2上安装了ayi2.0 advanced,并且我的php yii migrate/up命令不起作用。它显示:
with message 'could not find driver'
in /opt/lampp/htdocs/yii/vendor/yiisoft/yii2/db/Connection.php:584
我用谷歌搜索了一下,得到了几个结果。在那里,我读到了'use php -m command';你会意识到你的系统使用了哪些php。但我不知道运行该命令后的预期输出是
我正在研究yii2。我有一个创建功能,我想运行在后台后,每24小时。
public function actionCreate()
{
$model = new MeterPing();
// CURL code to get results from web-api
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id'
我创建了yii2项目。当我键入yii migrate commant时,它显示以下错误:
Exception 'ReflectionException' with message 'Class db does not exist'
in C:\OpenServer\domains\chamber_development\yii2chamber\vendor\yiisoft\yii2
i\Container.php:422
Stack
我在yii2高级模板上工作,我需要上传图像的小模块。上传工作正常,但当我试图让上传的图像在视图中渲染时,我收到了这个错误:
An Error occurred while handling another error:
exception 'yii\web\ForbiddenHttpException' with message 'You are not allowed to perform this action.' in /var/www/html/yii_advance/vendor/yiisoft/yii2/filters/AccessC
我有一个在我的应用程序的beforeAction事件上运行的简单代码:
'on beforeAction' => function ($event) {
throw new \yii\web\NotFoundHttpException('The requested page does not exist.');
},
我希望它只显示我的应用程序的404页,但是它会抛出以下错误:
An Error occurred while handling another error:
exception 'yii\web\NotFoundHttpExc
我在feature-1-login分支下运行代码:https://github.com/dzidlicious/invest-tracker 在运行docker-compose up并访问应用程序的后端部分后,我得到了以下堆栈跟踪: yii\base\ErrorException: Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory does not exist: '
in /app/vendor/yiisoft/yi