Can you use CRON to run PHP files?#

Yes you can.

Firstly you need to add a line to your PHP script. It has to be the first line of your script and must contain the server's PHP executable location:

#!/usr/bin/php -q

Please check with support where your php binary is located.

The -q flag suppresses HTTP header output. As long as your script itself does not send anything to stdout, -q will prevent cron from sending you an email every time the script runs. For example, print and echo send to stdout. Avoid using these functions if you want to prevent cron from sending you email.

After that let's add the necessary command to our crontab. This can be done vi plesk, or command line if you have access, make sure the command running section is like below:

5 * * * * php /full/path/to/your/php/script.php

Be sure your "script.php" has the necessary permissions to be executable ("chmod 755 script.php").

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 24-May-2017 15:30 by UnknownAuthor
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X

All Pages

Page views: 2577

Private Tomcat




SQL Server




Web Mail

Windows Plesk

Linux Plesk




Persits ASPUpload

Wiki Help

Referring Pages:

JSPWiki v2.8.1