Your Ad can be there
+ Post New Thread
Results 1 to 4 of 4

Thread: What are Cronjob linux commands to run PHP file?

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,731

    What are Cronjob linux commands to run PHP file?

    Hello, on my website i uploaded .php file i want to run regularly. http://domain.com/file.php

    I want to ask what are the commands to run this file in cronjob command line?

    ---
    EDIT: i found this to be working: curl
    http://domain.com/file.php

  2. #2


    Is this useful / helpfull? Yes | No
    wget -q -O - http://domain.com/file.php >/dev/null 2>&1


    This too will work.

  3. #3


    Is this useful / helpfull? Yes | No
    If you are using cpanel then you can easily add cron job being a beginner too.
    You can add cron job in cpanel easily.

  4. #4
    Junior Member Rex_M's Avatar
    Join Date
    Apr 2022
    Posts
    14


    Is this useful / helpfull? Yes | No

    Lightbulb

    Quote Originally Posted by Fli View Post
    Hello, on my website i uploaded .php file i want to run regularly. http://domain.com/file.php

    I want to ask what are the commands to run this file in cronjob command line?

    ---
    EDIT: i found this to be working: curl
    http://domain.com/file.php

    Hello Fli,

    I hope you are doing well!

    The usual method for running PHP files by a cron job is to use a command-line program such as wget or curl. For example, the cron job will run a command alike the following command:

    curl http://example.com/script.php

    In the above command, the curl retrieves the web page, which then executes the PHP file. You can also run the PHP file directly by using the PHP command-line interpreter. This method is just as effective and usually more faster. You can run the PHP file with the below command,

    php -q ${HOME}/public_html/script.php

    If you have cPanel access, you can easily set up the cron job and schedule your task to run your PHP files. To run the PHP files, you must set this up using cPanel's cron jobs feature.

    --------------------
    Regards,
    Rex_M

+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 09-06-2017, 02:49 PM
  2. Replies: 0
    Last Post: 11-04-2014, 01:42 PM
  3. Replies: 0
    Last Post: 11-03-2014, 07:24 PM
  4. Replies: 0
    Last Post: 12-09-2013, 12:35 PM
  5. Replies: 0
    Last Post: 09-02-2013, 10:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam