SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Cron Job

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cron Job

    Hello,

    I'm trying to set up a cron job using Plesk but I'm having trouble getting it to work.

    I think the problem is in stating the path to PHP and the path to the script, does anyone know how I'd find out what the paths are?

    Cheers,

    Jon

  2. #2
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In cPanel => /usr/local/bin/php -f path-to-your-php-file.php
    in Plesk => /usr/bin/php -f path-to-your-php-file.php

    You can also directly use wget URL-to-your-php-file.php

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try from a shell which php to find the path to the interpreter

    the path to the actual script, put this in it and run through web browser
    PHP Code:
    <?php
    echo __FILE__;
    Be aware, relative filepaths don't behave the same when you run php via the command line. It may use a seperate php.ini file as well.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •