Maybe you can help me with this, when we execute the commands by hand everything is ok:
$_SERVER =
array(39) {
["HOSTNAME"]=>
string(27) "serverhostname"
["SHELL"]=>
string(9) "/bin/bash"
["TERM"]=>
string(5) "xterm"
["HISTSIZE"]=>
string(4) "1000"
["SSH_CLIENT"]=>
string(22) "…"
["QTDIR"]=>
string(17) "/usr/lib64/qt-3.3"
["QTINC"]=>
string(25) "/usr/lib64/qt-3.3/include"
["SSH_TTY"]=>
string(10) "/dev/pts/0"
["USER"]=>
string(4) "root"
["LS_COLORS"]=>
string(1253) "rs=0:di=01;34:ln=01;36:mh=00



["PATH"]=>
string(141) "/usr/local/jdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin"
["MAIL"]=>
string(20) "/var/spool/mail/root"
["PWD"]=>
string(26) "/home/hostname/importation"
["JAVA_HOME"]=>
string(14) "/usr/local/jdk"
["EDITOR"]=>
string(4) "pico"
["LANG"]=>
string(11) "en_US.UTF-8"
["HISTCONTROL"]=>
string(10) "ignoredups"
["HOME"]=>
string(5) "/root"
["SHLVL"]=>
string(1) "2"
["LS_OPTIONS"]=>
string(25) "--color=tty -F -a -b -T 0"
["LOGNAME"]=>
string(4) "root"
["CVS_RSH"]=>
string(3) "ssh"
["QTLIB"]=>
string(21) "/usr/lib64/qt-3.3/lib"
["VISUAL"]=>
string(4) "pico"
["SSH_CONNECTION"]=>
string(38) "…"
["CLASSPATH"]=>
string(32) ".:/usr/local/jdk/lib/classes.zip"
["LESSOPEN"]=>
string(25) "||/usr/bin/lesspipe.sh %s"
["HISTTIMEFORMAT"]=>
string(6) "%F %T "
["G_BROKEN_FILENAMES"]=>
string(1) "1"
["_"]=>
string(18) "/usr/local/bin/php"
["PHP_SELF"]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
["SCRIPT_NAME"]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
["SCRIPT_FILENAME"]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
["PATH_TRANSLATED"]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
["DOCUMENT_ROOT"]=>
string(0) ""
["REQUEST_TIME_FLOAT"]=>
float(1452084877.58)
["REQUEST_TIME"]=>
int(1452084877)
["argv"]=>
array(3) {
[0]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
[1]=>
string(14) "--key=imp_prod"
[2]=>
string(15) "--template_id=6"
}
["argc"]=>
int(3)
}
But when we use Crontab Linux to execute the commands it seems the server variables are differents and causes errors:
$_SERVER =
array(15) {
["SHELL"]=>
string(7) "/bin/sh"
["MAILTO"]=>
string(25) "name@mydomain.com"
["USER"]=>
string(8) "myuser"
["PATH"]=>
string(13) "/usr/bin:/bin"
["PWD"]=>
string(14) "/home/hostname"
["LANG"]=>
string(11) "en_US.UTF-8"
["SHLVL"]=>
string(1) "1"
["HOME"]=>
string(14) "/home/hostname"
["LOGNAME"]=>
string(8) " myuser"
["_"]=>
string(12) "/usr/bin/php"
["PHP_SELF"]=>
string(0) ""
["REQUEST_TIME_FLOAT"]=>
float(1451933701.83)
["REQUEST_TIME"]=>
int(1451933701)
["argv"]=>
array(4) {
[0]=>
string(76) "/home/hostname/public_html/administrator/components/com_csvi/helper/cron.php"
[1]=>
string(18) "--task=maintenance"
[2]=>
string(18) "--addon=virtuemart"
[3]=>
string(20) "--operation=backupvm"
}
["argc"]=>
int(4)
}
Here are the errors, nothing is executed :
Notice: Undefined index: SCRIPT_NAME in /home/hostname/public_html/libraries/joomla/application/web.php on line 869
Notice: Undefined index: SCRIPT_NAME in /home/hostname/public_html/libraries/joomla/application/web.php on line 1139
Notice: Undefined index: SCRIPT_NAME in /home/hostname/public_html/libraries/joomla/uri/uri.php on line 96
Notice: Undefined index: SCRIPT_NAME in /home/hostname/public_html/libraries/joomla/uri/uri.php on line 167