D
D
Daniil Sidorov2018-05-10 22:01:57
ISPmanager
Daniil Sidorov, 2018-05-10 22:01:57

How to execute cron command in yii2?

Hello, I recently asked a similar question, but could not get an answer. Apparently due to lack of information. I will try to describe in more detail.
I am transferring a site ( yii2 basic ) from a local server to a hosting. I use REGRU hosting , hosting control panel - ISP Manager . Problem - I can not set up the "Task Scheduler" correctly.
On the local server, I ran the command as follows:

//%progdir%\modules\php\%phpdriver%\php-win.exe -c %progdir%\modules\php\%phpdriver%\php.ini -q -f %sitedir%\mysite.loc\yii cron/end-order

On the hosting, I'm trying to run the following:
/usr/bin/php var/www/u0499712/data/www/mysite.com/yii cron/end-order

I receive the following message:
Could not open input file: var/www/u0499712/data/www/mysite.com/yii

PS Added / before var , now I get this error
PHP Parse error:  syntax error, unexpected T_OBJECT_OPERATOR in /var/www/u0499712/data/www/myslite.com/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php on line 15

PHP version on the server: 7.0 (although it outputs 5.3...)
It seems to me that the problem is in the PHP version. I change but nothing happens.
Please tell me what I'm doing wrong. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Sidorov, 2018-05-11
@DaniLaFokc

The problem was solved by changing the path to PHP
Apparently version 5.3 was used in the past case

P
phpMonkey, 2019-11-01
@phpMonkey

I ran into the same problem, I solved it the same way: by writing the full paths
, but I will supplement the comment above, if hosting support is stupid, like Siberian boots, and there is a lot of useful information in the documentation and FAQ, then the path to php can be found from the PHP_BINDIR variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question