Cron job using php from Litespeed

Discussion in 'General' started by nicksnels, Oct 16, 2007.

  1. nicksnels

    nicksnels New Member

    Hi,

    I have made a cron job that should run a php script each 15 minutes. My PHP 5 that is used by Litespeed is installed in /php5/bin/php. So my cron job looks like:

    15,30,45,59 * * * * root /php5/bin/php /path_to_php_script

    But nothing happens. What is going on? Is it possible to execute php scripts like this? Thanks.

    Kind regards,

    Nick
  2. mistwang

    mistwang LiteSpeed Staff

    Please try "/php5/bin/php /path_to_php_script" from command line first, make sure it works.
  3. nicksnels

    nicksnels New Member

    I did that. But it also didn't give the desired output. When I do /php5/bin/php -v , I get the php version back, so I guess I'm using the right one.
  4. ffeingol

    ffeingol New Member

    Does the php -v say that it's LSAPI or a CLI version?

    Frank
  5. mistwang

    mistwang LiteSpeed Staff

    LSAPI can be used as CLI PHP interpreter. I think both version should do the job.
    Does you script require any PEAR module? maybe you check whether required module can be found by PHP, You can try

    "/php5/bin/php -c path_to_php.ini /path_to_php_script" see if it works.
  6. nicksnels

    nicksnels New Member

    Thanks for the help. It turned out that not the cron job was the problem, but that the mails send out by the cron job were blocked by the mail server.

Share This Page