+ Reply to Thread
Results 1 to 5 of 5

Thread: CRON setup

  1. #1
    Registered User On a golden path... scottmcarthur's Avatar
    Member since
    Jun 2004
    Location
    UK
    posts
    394
    Gave thanks
    0
    Thanked 1 Time in 1 Post

    CRON setup

    Hi PPL

    I am trying to use CRON to run a php script in my account, but I am unsure of the command to use. I tried:

    Code:
    /home/<username>/cron_tasks/status.php
    "cron_tasks" is a folder i created in the base of my account - outside my public_html.

    I am getting a Permission Denied responce from CRON daemon.

    So how do I get it to run the PHP page as if it was browsing it ?

    Can somebody help ?

    Cheers,
    Scott

  2. #2
    Registered User Seasoned Poster
    Member since
    May 2003
    posts
    75
    Gave thanks
    0
    Thanked 0 times
    Did you set the execute flag on the script file?

  3. #3
    Registered User On a golden path... scottmcarthur's Avatar
    Member since
    Jun 2004
    Location
    UK
    posts
    394
    Gave thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for the suggestion ...

    Still having problems - I just tried changing the permissions of the file to 755 to allow execution - but the problem is it not using PHP to parse it. Instead it is trying to execute the PHP file as an application which obviously its not.

    So the question still remains - how do you CRON a php file ?

    I think I would need to give it some command to navigate to it ?


  4. #4
    Registered User On a golden path... scottmcarthur's Avatar
    Member since
    Jun 2004
    Location
    UK
    posts
    394
    Gave thanks
    0
    Thanked 1 Time in 1 Post
    Hello,


    I finally solved my own problem :love3:

    If you are interested to know the code required to run PHP scripts automatically:

    /home/<directory>/<script.php>

    Code:
    /usr/local/bin/php /home/(username)/(directory)/(scriptname.php) >/dev/null
    Its logical after all that!

  5. #5
    Registered User Seasoned Poster
    Member since
    May 2003
    posts
    75
    Gave thanks
    0
    Thanked 0 times
    Just curious,

    Did you create the file as standard php or did you create a type called "shell script"?

    because with shell script I don't need the "/usr/local/bin/php"

    Agix

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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