php - Yii shell_exec yiic command run not working -


i trying send large number of email notifications using yiic , run cconsolecommand.

command okay. there no php errors. can't run linux command using shell_exec.

here part of code

if ($post->save()) {    chdir(yii::app()->basepath);   shell_exec('yiic makemasspost ' . $post->id . ' ' . $id . ' > log.txt & echo $!');  } 

there no point in going linux yii run command runs yii application again.

you can try running directly yii

yii::import('application.commands.*'); $command = new mycommand("test", "test"); $command->run(null); 

Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -