I need to execute my cron job with lsphp52

Discussion in 'Bug Reports' started by DraCoola, Aug 4, 2013.

  1. DraCoola

    DraCoola Member

    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 ?
  2. NiteWave

    NiteWave Administrator

    so it doesn't support "-q" option.

    just run
    /path-to-lsws/fcgi-bin/lsphp-5.2.17
    but remove "-q" option, should be ok.
  3. DraCoola

    DraCoola Member

    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
  4. NiteWave

    NiteWave Administrator

    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
  5. DraCoola

    DraCoola Member

    once again : thank you very much, NiteWave
    you and -c are so awesome [​IMG]
  6. DraCoola

    DraCoola Member

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


    [​IMG]


    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 :(
  7. NiteWave

    NiteWave Administrator

    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 ?
  8. DraCoola

    DraCoola Member

    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).
  9. NiteWave

    NiteWave Administrator

    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.

Share This Page