Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:36:33+00:00 2026-06-12T23:36:33+00:00

Ok I have been looking into cron jobs for hours, checked every post here,

  • 0

Ok I have been looking into cron jobs for hours, checked every post here, looked in google but I just do not understand how it works.

I have set up a cron job using my path 1 * * * * /home/myuser/domains/mysite/public_html/live.php I have also tried /home/myuser/public_html/live.php
Nothing seems to be working.

Do I have to add something in the php file (live.php)? That is the code that has to be executed. The code itself works.

I know you will all think that I am lazy but I really can’t figure this out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:36:35+00:00Added an answer on June 12, 2026 at 11:36 pm

    *.php is regular script file which, as any other scripting languages like i.e. perl requires interpreter to run. So if you want to run your script from command line you have either call interpreter and give it your script file as argument, like:

    $ /usr/bin/php myscript.php
    

    And that’s it – it should run.

    Or (if working using linux/bsd) add as very first line of your PHP script file:

    #!/usr/bin/php -q
    

    which tells shell, where to look for interpreter for this script file. Please ensure your PHP is in /usr/bin folder as this may vary depending on the distro. You can check this using which, like this:

    $ which php
    /usr/bin/php
    

    if path is right, you yet need to set executable bit on script file so you’d be able to try to “launch it”:

    chmod a+x myscript.php
    

    This will make it behave as any other app, so you’d be able to launch it this way:

    /full/path/to/myscript.php
    

    or from current folder:

    ./myscript.php
    

    And that’s it for that approach. It should run.

    So your crontab line would look (depending on the choosen approach):

    1 * * * * /full/path/to/myscript.php
    

    or

    1 * * * * /usr/bin/php -q /full/path/to/myscript.php
    

    And you should rather use “0” not “1”, as 1st minute in hour is zero, i.e.:

    0 * * * * /usr/bin/php -q /full/path/to/myscript.php
    

    EDIT

    Please note cron working directory is user’s home directory. So you need to put that into consideration, which usually means using absolute pathes. Alternatively you’d prepend your call with cd <script working path> && /usr/bin/php -q /full/....

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking into AWS spot instances for some jobs however instead of
I have been looking into HTML5 manifest but I am unclear as to whether
I have been looking into Spring Social Facebook's publish(objectId, connectionName, data) API , but
So I have been looking into implementing a lowest common ancestor algorithm. I looked
I am an experienced PHP programmer, but I have been looking into Ruby lately,
I have been looking into the Google Objective-c API, there is a small amount
I have been looking into webkit HTML offscreen rendering lately, but i am unable
I have been looking into this for some hours now and can't figure it
I have been looking into this for hours and still at a loss. I
I use Tortoise SVN usuallly, but I have been looking into Mercurial since it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.