I am building an application on Yii2 framework. I need to create a cron job to automatically send birthday and anniversary SMS. I started writing code in Commands/TestController and its working fine in command line on my windows PC. Also I have SSH access and code is running there as well. I have received the SMS. Here is the command:
But problem is, when I apply same command over cron job in cPanel, then it doesn’t work and gives me ‘PDO not Found’ error in email. Here is what I receive in email:
Status: 500 Internal Server Error
X-Powered-By: PHP/5.4.39
Content-type: text/html
PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'PDO' not found'
in /home/user/public_html/vendor/yiisoft/yii2/db/Connection.php:609
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}
I have researched a lot on internet about this but did not get any close answer. Already post this in SO but did not get any answer so I decided to post here. Since this is my first post here so I am not able to post link.
I used this command but its giving me error on both ssh and cron. And also I checked PHP version using ‘php -v’ its PHP 5.4.39 (cli) (built: Apr 17 2015 11:53:42)