LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > Cron job using php from Litespeed

Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2007, 07:39 AM
nicksnels nicksnels is offline
Member
 
Join Date: Feb 2007
Posts: 33
Default Cron job using php from Litespeed

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
Reply With Quote
  #2  
Old 10-16-2007, 09:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Please try "/php5/bin/php /path_to_php_script" from command line first, make sure it works.
Reply With Quote
  #3  
Old 10-16-2007, 09:47 AM
nicksnels nicksnels is offline
Member
 
Join Date: Feb 2007
Posts: 33
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.
Reply With Quote
  #4  
Old 10-16-2007, 10:01 AM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
Does the php -v say that it's LSAPI or a CLI version?

Frank
Reply With Quote
  #5  
Old 10-16-2007, 10:05 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
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.
Reply With Quote
  #6  
Old 10-17-2007, 05:05 AM
nicksnels nicksnels is offline
Member
 
Join Date: Feb 2007
Posts: 33
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:20 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.