Reputation: 23
I am trying to send large number of email notifications using Yiic
and run CConsoleCommand
.
Command is okay. There are no PHP errors. I can't run linux
command using shell_exec
.
Here is part of code
if ($post->save()) {
chdir(Yii::app()->basePath);
shell_exec('yiic makemasspost ' . $post->id . ' ' . $id . ' > log.txt & echo $!');
}
Upvotes: 0
Views: 945
Reputation: 9357
There is no point in going to linux from yii to run a command that actually runs an yii application again.
You can try running it directly from Yii
Yii::import('application.commands.*');
$command = new MyCommand("test", "test");
$command->run(null);
Upvotes: 0