Results 1 to 4 of 4

Thread: PHP URL to Cron

  1. #1

    PHP URL to Cron

    I have a reseller Cpanel account with limited shell access. I also have a URL from my website that can run a php script. I want to set that URL to run as a cron. The URL has ? = &.

    When I try to run the script from shell, I get a could not open input file. How can I set the url up as a cron to run?

  2. #2
    Hello,

    Is the script hosted on the same server or remotely? You cant execute remote php code, it will run on the server an output the results. If its hosted on the server use the exact location like /home/username/scriptname and create a cron that way.

  3. #3
    Join Date
    Mar 2005
    Location
    Ten1/0/2
    Posts
    2,529
    use wget or curl?

    pass the file to a command interpreter eg php ?
    CPanel Shared and Reseller Hosting, OpenVZ VPS Hosting. West Coast (LA) Servers and Nodes
    Running Linux since 1.0.8 Kernel!
    Providing Internet Services since 1995 and Hosting Since 2004

  4. #4
    Quote Originally Posted by UplinkVPS View Post
    Hello,

    Is the script hosted on the same server or remotely? You cant execute remote php code, it will run on the server an output the results. If its hosted on the server use the exact location like /home/username/scriptname and create a cron that way.
    Thanks, I tried this way and got an error.

    Quote Originally Posted by RRWH View Post
    use wget or curl?

    pass the file to a command interpreter eg php ?
    I set up the cron in cpanel and used curl. It worked. e.g curl "http://... "

    Thanks to both for your help!

Similar Threads

  1. PHP 4, MySQLPHP Mail, PHP GD2, Cron job (5 minutes)
    By Chinmoku-San in forum Web Hosting
    Replies: 10
    Last Post: 02-19-2012, 07:34 AM
  2. [PHP] Passing a URL through a URL
    By krissauquillo in forum Programming Discussion
    Replies: 5
    Last Post: 12-11-2007, 02:53 PM
  3. php -> how to easily have url.php?page=sitename sort of link?
    By Rui in forum Programming Discussion
    Replies: 4
    Last Post: 04-26-2005, 07:59 AM
  4. Cron and PHP (PHP as apache module)
    By the_lar222 in forum Web Hosting
    Replies: 2
    Last Post: 07-23-2004, 10:03 AM
  5. PHP and cron
    By NewonNet in forum Dedicated Server
    Replies: 5
    Last Post: 11-11-2001, 06:20 PM

Posting Permissions

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