G
G
gachkydxvbgd2017-10-16 16:23:51
Yii
gachkydxvbgd, 2017-10-16 16:23:51

How to run cron yii2 on hosting?

fSqiu9wPSqqRQ_tLSgpabA.pngJe9fSFi_Sf_E4Qu5Lm9z4A.png
The yii hello/index command works on localhost, but not on hosting, how to set it up correctly?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2017-10-16
@slo_nik

Good afternoon.
First, look in the server logs to see why the command is not being executed.
Secondly, the command will not work for you, because there is no such file on the server as "yii hellow".
You need to specify the path to the "hello" console controller, something like this:

/usr/bin/php ~/domain/public_html/console/hello/index

S
Sanes, 2017-10-16
@Sanes

in the crown, your command will look something like
the one in the screenshot

V
vksee, 2017-10-18
@vksee

Judging by the screenshot, in your case this parameter should be:
There should not be a space to the left of yii, /domain/public_html/yii is the path to the script file.
Make sure there is a /domain/public_html/ directory that contains the yii.
In general, running this script from anywhere:
The command sounds something like this: run php, which will run the script /domain/public_html/yii with the parameters hello/index.
If the yii file is marked as executable, then you can:
And do not forget that this is not a web application, but a console one, with its own nuances.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question