Answer the question
In order to leave comments, you need to log in
How to run cron yii2 on hosting?
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
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
in the crown, your command will look something like
the one in the screenshot
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 questionAsk a Question
731 491 924 answers to any question