Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php yii2 cron给出的错误为;“未找到PDO”;_Php_Mysql_Pdo_Cron_Yii2 - Fatal编程技术网

Php yii2 cron给出的错误为;“未找到PDO”;

Php yii2 cron给出的错误为;“未找到PDO”;,php,mysql,pdo,cron,yii2,Php,Mysql,Pdo,Cron,Yii2,我在yii2中运行的应用程序很好。我创建了一个命令控制器/commands/TestController <?php namespace app\commands; use app\models\UserProfile; use yii\console\Controller; use app\controllers\AppController; /** * Test controller */ class TestController extends Controller {

我在yii2中运行的应用程序很好。我创建了一个命令控制器/commands/TestController

<?php

namespace app\commands;

use app\models\UserProfile;
use yii\console\Controller;
use app\controllers\AppController;
/**
 * Test controller
 */
class TestController extends Controller
{

    public function actionIndex()
    {
        echo "cron service running";
    }

    public function actionSendBirthdaySms()
    {
        $userProfile = UserProfile::find()
            ->where('MONTH(dob) = MONTH(DATE(NOW()))')
            ->andWhere('DAY(dob) = DAY(NOW()) ')
            ->with('user')
            ->asArray()
            ->all();

        foreach($userProfile as $item){
            $birthdayMessage = "Happy Birthday " . $item['user']['username'];
            //to send sms
            $this->_send_cron_sms($item['mobile'], $birthdayMessage);
        }
    }

我还尝试了查询生成器,但它也没有帮到我。

我通过在php.ini文件中添加这两个扩展名解决了这个问题

extension=pdo.dll
extension=pdo_mysql.dll
我已经问过同样的问题了

extension=pdo.dll
extension=pdo_mysql.dll