I need to execute my cron job with lsphp52

DraCoola

Well-Known Member
#1
I did dual php (5.2.17 and 5.3.x) and works fine with all http://website with additional .htaccess AddType directive.
But running cron job (php -f or -q /my-path/script.php) still execute php as 5.3 :confused:

I have try /path-to-lsws/fcgi-bin/lsphp-5.2.17 -q but resulting an error :
Code:
Could not open input file: /my-path/script.php
-h giving me these :
Code:
Usage: php
      php -[b|c|n|h|i|q|s|v|?] [<file>] [args...]
  Run in LSAPI mode, only '-b', '-s' and '-c' are effective
  Run in Command Line Interpreter mode when parameters are specified

  -b <address:port>|<port> Bind Path for external LSAPI Server mode
  -c <path>|<file> Look for php.ini file in this directory
  -n    No php.ini file will be used
  -h    This help
  -i    PHP information
  -l    Syntax check
  -q    Quiet-mode.  Suppress HTTP Header output.
  -s    Display colour syntax highlighted source.
  -v    Version number
  -?    This help
which one of those usage above or any way methode that will help me to execute my cron job with lsphp52 ?
 

DraCoola

Well-Known Member
#3
Hi NiteWave thanks for your explanation, I will try that.
By the way is that /path-to-lsws/fcgi-bin/lsphp-5.2.17 without -q will have a chance to use custom php.ini from PHPIniDir ?

Because right now I found alternative solution by using /path-to-lsws/lsphp52/bin/php but it seems using php.ini from /path-to-lsws/lsphp52/lib
 

NiteWave

Administrator
#4
this option still available:
-c <path>|<file> Look for php.ini file in this directory

e.g.,
/path-to-lsws/lsphp52/bin/php -c /path-to-PHPIniDir/myphp.ini
 

DraCoola

Well-Known Member
#6
but... hosnestly, I found that running lsphp52 with or without -c from Cpanel /var/spool/cron/username will produce this error :





but perform that command directly from console will works as it should be.
so I have to delete all of Cpanel interface crons and move them to crontab -e :(
 

NiteWave

Administrator
#7
don't know about Cpanel /var/spool/cron/username yet,
not sure if the php52 in the screenshot is the one /path-to-lsws/lsphp52/bin/php ?
 

DraCoola

Well-Known Member
#8
write cronjob from Cpanel >> Advanced Tools >> Cron Jobs will put cron command to /var/spool/cron/username

--------------------
http://www.google.com/search?q=where+is+cpanel+cron+file
--------------------

php52 is symlinked from /path-to-lsws/fcgi-bin/lsphp-5.2.17 to /usr/bin/php52
I have try that symlink and direct path but still got the same email error report.

but it works well when perform directly from console, or placed as cron through crontab -e (as root).
 

NiteWave

Administrator
#9
php52 is symlinked from /path-to-lsws/fcgi-bin/lsphp-5.2.17 to /usr/bin/php52
I have try that symlink and direct path but still got the same email error report.
if you put > /dev/null at the end of command, you may not receive email.

>/dev/null is used to mimic "-q" option which not supported by lsphp.
 
Top