www.webdeveloper.com
Results 1 to 7 of 7

Thread: not a php but cron jobs, need help

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    58

    Question not a php but cron jobs, need help

    Hello, i'm trying to set cron jobs properly for me, but i have some troubles.
    What i'm have:
    When i use this command all work okay, this is only path to file:
    PHP Code:
    /usr/bin/php -/home/username/public_html/file_name.php 
    But i need to use file with GET request i want that in set time cron will open a file.php?get=query some think like that
    I found that command but it work extremely wrong (when it work i get an email from cron with error but error doesn't write, all i get is message contains only "?" and few "@" letters), my tech support said me that i had error in my code( but i test my code and it work fine without cron), so i need your help. What is wrong in my command?
    PHP Code:
    /usr/bin/php -/usr/bin/wget "http://domain.com/file.php?my_get=blablabla" 
    Thanks.

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    Have you tried running the code manually to see if you get any errors back?

  3. #3
    Join Date
    Dec 2011
    Posts
    34
    /usr/bin/php -q /usr/bin/wget "http://domain.com/file.php?my_get=blablabla"
    And just how do you expect PHP to execute wget?

    either use a php script with the php binary, or use wget binary files.

    if you need both either use exec within yer php script or use a shell script to call each one consequetuvely

  4. #4
    Join Date
    May 2011
    Posts
    58
    i expect that cron jobs will execute my php file and it will execute with get request, i mean that in my php file i will can use $_GET['my_get'];

  5. #5
    Join Date
    Dec 2011
    Posts
    34
    I repeat once more: WGET is a binary file not a php script, there is no way that command will work. The php binary only executes php scripts not native compiled applications

  6. #6
    Join Date
    Jan 2009
    Posts
    3,346
    Maybe you need to read up on how to handle input from the CLI... http://www.php.net/manual/en/feature...line.usage.php

    Instead of using "_GET" you would use the argv/argc version...

  7. #7
    Join Date
    May 2011
    Posts
    58
    yes i tried to running code without cron, and with cron but without get query, as i show previously. The problem is how to set up cron for use not just a file, but file with get query
    If i try this:
    PHP Code:
    /usr/bin/php -/usr/bin/wget "http://domain.com/file.php?my_get=blablabla" 
    cron send me email "No input file specified"
    How can i make this work?

Thread Information

Users Browsing this Thread

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

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
  •  
HTML5 Development Center



Recent Articles