Plesk Scheduled Tasks: completed with error in 0 seconds?

Moebuntu

Well-known member
Joined
Jul 1, 2016
Messages
103
Points
18
when I tried to run a cron job script in Plesk - Scheduled Tasks

plesk-cron-jobs.png

It immediately show me this alert

Code:
Task "http://example.com/cronjob.php" completed with error in 0 seconds.
Does my cronjob.php file have errors so that cron job could not run? if so how to fix error in this file?
 

Attachments

IgorG

Member
Joined
Jul 22, 2016
Messages
58
Points
8
What is content and parameters of this task?
 

Moebuntu

Well-known member
Joined
Jul 1, 2016
Messages
103
Points
18
Moebuntu
I set up it like this

plesk-cron-job1.png

I tried to move from PHP7 to php5.6.28 but still getting same alert. (my script supports php7 and php 5.x+)

I don't know this is an alert for getting error or not?

but my script (cron job) ran and I could see results in result page of it.
 

Moebuntu

Well-known member
Joined
Jul 1, 2016
Messages
103
Points
18
Sorry the result I got from my cronjob.php is run from cron-job[dot]org

I don't know why I could not run with schedule task in Plesk Onyx?

This is thing I set up in cron-job.org and my script could run but with Plesk then not.

new-cronjob.png
 

IgorG

Member
Joined
Jul 22, 2016
Messages
58
Points
8

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,623
Points
83
If you want to run a php script, you can do it using "fetch an URL". It's the same than using "curl http://mywebsite.com/wp-cron.php"

Screenshot_10.png

Or by running the script via php, and in this case you can use "run a php script but you have to set the correct path of your script.

Last way, you can run directly your command like :

/opt/plesk/php/7.0/bin/php /var/www/vhosts/yourdomain.com/httpdocs/yourcron.php
 
Latest Threads
Replies
0
Views
1
Replies
0
Views
14
Replies
4
Views
39
Replies
0
Views
1

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top