D
D
Daniil Sidorov2018-02-14 17:13:31
Yii
Daniil Sidorov, 2018-02-14 17:13:31

How to execute a scheduled task in Yii2?

Hello, I am using yii2 basic and OpenServer . You need to create a task that will run every minute. In the commands
folder , I created a CronController and created the necessary action in it. I can run this action via the console (in the project folder) by writing But how do I specify the path to the script in the Task Scheduler on OpenServer? Thanks in advance!
php yii cron/index

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OKyJIucT, 2018-02-14
@DaniLaFokc

Specify the full path to the yii file, which is at the root. You can view it with the function
echo dirname(__FILE__);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question