1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

vps HELP!!!! how do you run php scripts?

Discussion in 'Web Hosting' started by tomaso88, May 28, 2010.

  1. tomaso88

    tomaso88 Registered Member

    Joined:
    Apr 14, 2010
    Messages:
    89
    Likes Received:
    20
    How do you get a vps to run a php script 24/7? im with hostgator
     
  2. xXSebaSXx

    xXSebaSXx Registered Member

    Joined:
    May 8, 2009
    Messages:
    52
    Likes Received:
    28
    Your question is a bit vague, but I think you're looking for cron jobs.
     
  3. tomaso88

    tomaso88 Registered Member

    Joined:
    Apr 14, 2010
    Messages:
    89
    Likes Received:
    20
    sorry never used vps before ill check out what u said and hope for the best
     
  4. tomaso88

    tomaso88 Registered Member

    Joined:
    Apr 14, 2010
    Messages:
    89
    Likes Received:
    20
    EDIT: howdo i get in cronjobs?
     
  5. xXSebaSXx

    xXSebaSXx Registered Member

    Joined:
    May 8, 2009
    Messages:
    52
    Likes Received:
    28
    That would be from your CPannel inside your hosting account. You may want to contact hostgator support and ask them to show you how to set up a cron-job. Once they show you once it's just a matter of customizing that cron-job to suit your needs.
     
  6. tomaso88

    tomaso88 Registered Member

    Joined:
    Apr 14, 2010
    Messages:
    89
    Likes Received:
    20
    im not talking about in cpanel im talking about on a private sever
     
    Last edited: May 29, 2010
  7. tomaso88

    tomaso88 Registered Member

    Joined:
    Apr 14, 2010
    Messages:
    89
    Likes Received:
    20
    i need a vps to act like its on a site 24/7 so instead of me having to stay on let say example.com it stays on example.com its self and runs the php script how do i do that
     
  8. xXSebaSXx

    xXSebaSXx Registered Member

    Joined:
    May 8, 2009
    Messages:
    52
    Likes Received:
    28
    you need a vps to act like its on a site 24/7?....
    AFAIK vps means virtual private server and it's a type of hosting plan... like shared hosting, or dedicated hosting.
    I think you need to re-formulate your question better so that someone here may be able to help you out.
     
  9. MisterGemini

    MisterGemini Senior Member

    Joined:
    May 25, 2010
    Messages:
    1,113
    Likes Received:
    714
    Occupation:
    Observe & Report
    Location:
    Alternate Universe
    A) What kind of VPS and control panel are you running?
    B) Does the script need to run without turning off? Is that what you are asking?
    C) Did the script come with any instructions? If so, might be helpful to share.
     
  10. thxflash

    thxflash Power Member

    Joined:
    Jan 20, 2009
    Messages:
    786
    Likes Received:
    131
    Location:
    Newport Beach, CA
    Home Page:
  11. iglow

    iglow Elite Member

    Joined:
    Feb 20, 2009
    Messages:
    2,081
    Likes Received:
    856
    Home Page:
    install apache and then php
     
  12. andyh2

    andyh2 Junior Member

    Joined:
    Dec 19, 2009
    Messages:
    135
    Likes Received:
    42
    Location:
    Bay Area, CA
    You can either run them from the command line (via the "php" command) or on a website by simply visiting the URL (assuming your web server is set up).
     
  13. aroel

    aroel Newbie

    Joined:
    Jan 17, 2010
    Messages:
    26
    Likes Received:
    9
    Location:
    the net
    Home Page:
    in your console:

    in your cron:

     
  14. sipser

    sipser Newbie

    Joined:
    Feb 4, 2008
    Messages:
    43
    Likes Received:
    18
    Look up wget. It will visit your site via command line. Then set up a cron job to run it every minute.
     
  15. bamaboy

    bamaboy Registered Member

    Joined:
    May 25, 2009
    Messages:
    67
    Likes Received:
    9
    Location:
    The Interwebz
    or just insert the php code in an infinite loop.
    Login to your vps via shell and fire on
    Code:
    nohup php myscript.php &
    and close your shell session.
     
  16. ultrabizweb

    ultrabizweb Newbie

    Joined:
    Feb 1, 2009
    Messages:
    21
    Likes Received:
    4
    You could also use screen run the command and then detach the screen session using CTRL+AD I use screen all the time it is a great tool. To reattach to the session type screen -ls to list the sessions and then screen -r <sessionnametoreattach> to reattach to that session.