Plesk Scheduled Tasks: completed with error in 0 seconds?

Moebuntu

Well-known member
Joined
Jul 1, 2016
Messages
103
Best answers
0
Ratings
2 1
Points
18
#1
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

Joined
Jul 22, 2016
Messages
58
Best answers
0
Ratings
19 1
Points
8
#2
What is content and parameters of this task?
 

Moebuntu

Well-known member
Joined
Jul 1, 2016
Messages
103
Best answers
0
Ratings
2 1
Points
18
#3
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
Best answers
0
Ratings
2 1
Points
18
#4
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
 
Joined
Jul 22, 2016
Messages
58
Best answers
0
Ratings
19 1
Points
8
#5

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,524
Best answers
4
Ratings
398 12
Points
83
#8
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
4
Replies
2
Views
10
Replies
0
Views
6
  • Awaiting approval
Replies
0
Views
2
Recommended Threads

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