cron and php problem - BSD

This is a discussion on cron and php problem - BSD ; hello I have a problem with launching php script from cron. When I start script manually everything is ok -script is working ! In addiction i have set php safe mode on. crontab: */1 * * * * root /usr/local/bin/php ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: cron and php problem

  1. cron and php problem

    hello
    I have a problem with launching php script from cron.
    When I start script manually everything is ok -script is working !
    In addiction i have set php safe mode on.
    crontab:
    */1 * * * * root /usr/local/bin/php /usr/local/www/apache22/data/
    script.php

    From cron, this line in script doesn't work:
    system("/bin/cat /usr/local/www/apache22/data/users | grep -v '$nazwa'
    >> file_temp && /bin/cp file_temp users && /bin/rm /usr/local/www/

    apache22/data/file_temp");

    Do you have any clue?

    thank you!

  2. Re: cron and php problem

    darus wrote:
    > hello
    > I have a problem with launching php script from cron.
    > When I start script manually everything is ok -script is working !
    > In addiction i have set php safe mode on.
    > crontab:
    > */1 * * * * root /usr/local/bin/php /usr/local/www/apache22/data/
    > script.php
    >
    > From cron, this line in script doesn't work:
    > system("/bin/cat /usr/local/www/apache22/data/users | grep -v '$nazwa'
    >>> file_temp && /bin/cp file_temp users && /bin/rm /usr/local/www/

    > apache22/data/file_temp");
    >
    > Do you have any clue?

    Have you troed with the full path to the grep command?
    Remember, the environment in cron is limited, so things that work in
    your everyday shell doesn't always work in cron.
    See the cron man page for more info.
    --
    Torfinn Ingolfsen,
    Norway

  3. Re: cron and php problem

    On Fri, 14 Mar 2008 05:40:37 -0700 (PDT)
    darus wrote:

    > hello
    > I have a problem with launching php script from cron.
    > When I start script manually everything is ok -script is working !
    > In addiction i have set php safe mode on.
    > crontab:
    > */1 * * * * root /usr/local/bin/php /usr/local/www/apache22/data/
    > script.php
    >
    > From cron, this line in script doesn't work:
    > system("/bin/cat /usr/local/www/apache22/data/users | grep -v '$nazwa'
    > >> file_temp && /bin/cp file_temp users && /bin/rm /usr/local/www/

    > apache22/data/file_temp");


    Full paths to file_temp and users everywhere would probably help a
    lot, also to grep as Torfinn suggests.

    --
    C:>WIN | Directable Mirror Arrays
    The computer obeys and wins. | A better way to focus the sun
    You lose and Bill collects. | licences available see
    | http://www.sohara.org/

  4. Re: cron and php problem

    Full paths to file_temp and grep helped !!!


    thanks you

+ Reply to Thread