Answer the question
In order to leave comments, you need to log in
What is the best way to execute php script in cron?
Please tell me how, from the point of view of saving server resources, it is better to execute a php script: via wget or with the command:
/opt/plesk/php/7.0/bin/php -c /var/www/vhosts/system/site/etc/php.ini -f /var/www/vhosts/site/httpdocs/file.php
Answer the question
In order to leave comments, you need to log in
Yes, the mechanism is provided. I just thought maybe krone has some option.
100% via cli +, as already noted, use flovk, which will save you from re-running the script if the previous one has not completed its work.
Why is cli better? Because the script may run longer than, for example, the configured timeout on the web server. In the cli, the script is guaranteed to work, and don't forget to run it via sudo, for example:
sudo -u apache php ... script.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question