SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: PHP and CronJob

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Location
    Atlanta, GA
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and CronJob

    how can I dump the usual:

    X-Powered-By: PHP/4.0.4pl1
    Content-type: text/html

    thing that the cron sends me through the email...

    i have
    php /home/alpha/script/test.php >> /dev/null

    but it still sends me the email and its pissing me off...
    i've tried to use wget and lynx but no luck... anyone have any suggestions?

    thanks
    atomicVPS.com (Open Beta Phase)
    OnApp Powered Linux & Windows Cloud Hosting[/COLOR]

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Location
    Atlanta, GA
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    arg...
    also wondering if there is anyway to stop the output:

    X-Powered-By: PHP/4.0.4pl1
    Content-type: text/html


    which is created by php after its run?

    maybe i can stop the output within the code?
    atomicVPS.com (Open Beta Phase)
    OnApp Powered Linux & Windows Cloud Hosting[/COLOR]

  3. #3
    SitePoint Member
    Join Date
    Aug 2001
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you add the -q option, as a parameter, then the header
    information will not be printed.

    as far as output from cron, you can do this (if your default
    shell is sh,bash,ksh):

    php -q /home/alpha/script/test.php > /dev/null 2>&1

    the 2>&1 will send both standard error and standard output
    to /dev/null (or you can replace that with a file which would
    be a better idea).

    lp

  4. #4
    SitePoint Member
    Join Date
    Jun 2001
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by HobbyMan
    if you add the -q option, as a parameter, then the header
    information will not be printed.

    as far as output from cron, you can do this (if your default
    shell is sh,bash,ksh):

    php -q /home/alpha/script/test.php > /dev/null 2>&1

    the 2>&1 will send both standard error and standard output
    to /dev/null (or you can replace that with a file which would
    be a better idea).

    lp
    What would the syntax be for specifying a file?

    thanks,
    john

  5. #5
    SitePoint Enthusiast vsantola's Avatar
    Join Date
    Jan 2001
    Location
    Portugal
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try using lynx with the -dump option and that content-type stuff will not be outputed:

    lynx -dump http://yourhost.com/script.php > /dev/null
    Valter Santos

    rooco is my creature (a mix of a bear with a kanguroo)... he is trained in perl, PHP and is getting a java certification right now


Bookmarks

Posting Permissions

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