Plesk Scheduled Tasks: completed with error in 0 seconds?

Moebuntu

Well-known member
Registered
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
Registered
Joined
Jul 22, 2016
Messages
60
Points
8
What is content and parameters of this task?
 

Moebuntu

Well-known member
Registered
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
Registered
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
Registered
Joined
Jul 22, 2016
Messages
60
Points
8

VirtuBox

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
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
 
Recommended Threads
Replies
3
Views
2,125
Replies
10
Views
4,509
Replies
5
Views
2,724

Latest Hosting OffersNew Reviews

Sponsors

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