【发布时间】:2014-10-31 07:15:35
【问题描述】:
我正在尝试运行一个后端进程,但我遇到了让暴发户运行 yiic 命令的问题。
我正在使用 xampp 服务器
这是我的新贵脚本:
#description "Sample upstart"
#start on stopped
start on startup
stop on shutdown
respawn
chdir /opt/lampp/htdocs/my_project/protected
setuid mad
setgid www-data
script
exec /opt/lampp/htdocs/my_project/protected/yiic project test
end script
所以当我这样做时
sudo 启动测试监视器
暴发户正在启动,它似乎正在向 yii 项目发出命令,因为 yii 日志文件中捕获了错误。 yii日志文件中的错误是:
2014/10/31 15:06:44 [error] [worker.*] CDbConnection failed to open the DB connection: could not find driver
2014/10/31 15:06:44 [error] [worker.*] CDbConnection failed to open the DB connection: could not find driver
2014/10/31 15:06:44 [error] [worker.*] CDbConnection failed to open the DB connection: could not find driver
2014/10/31 15:06:44 [error] [worker.*] CDbConnection failed to open the DB connection: could not find driver
但是,如果我手动执行命令:
./yiic 项目测试
这工作正常。谁能帮帮我。
这里是 yii 控制台命令的代码:
public function actionTest(){
try{
while(1){
TestManager::_MonitorTest();
usleep(1000000);
}
}catch(Exception $e){
Yii::log( $e->getMessage(), 'error', 'worker.*');
}
}
这是暴发户的日志文件(不是这样,因为我把sudo去掉了):
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
Mysql 连接正常,我已经测试过了
【问题讨论】:
-
在以下目录
protected\config\console.php'中显示您的文件。在此之前检查componets数组索引db是否具有正确值的所有必需值。 -
给我 2 分钟,我会给你更多信息
-
根据您的要求编辑
-
您的评论如何成为答案?你没有帮助回答。就像我说的数据库设置没有问题。问题只是新贵调用该方法。