• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Command for Cron-task below the docroot

markusoswald

New Pleskian
Hi,

i need to run a cron-task, which is below the docroot. How can i submit a task? The following failed:

##Submit Task##
/usr/bin/php -q /var/www/vhosts/mydomain.de/crons/cron.php
php -q /var/www/vhosts/mydomain.de/crons/cron.php

##Submit PHP-Skript##
Path: crons/cron.php Order: -q
Path: crons/cron.php Order: php -q


Thanks a lot for help in advance.
 
Theoretically should work because you are under the same user. What is the error you get?
 
Thank´s for your reply,

following the error-message:

HP Fatal error: Uncaught exception 'ErrorException' with message 'Undefined index: default' in /var/www/vhosts/mydomain.de/crons/cron.php:0
Stack trace:
#0 /var/www/vhosts/mydomain.de/crons/cron.php(0): Composer\Util\ErrorHandler::handle(8, 'Undefined index...', '/var/www/vhosts...', 0, Array)
#1 {main}

Next exception 'ErrorException' with message 'Undefined index: default' in /var/www/vhosts/mydomain.de/crons/cron.php:0
Stack trace:
#0 [internal function]: WHMCS\Terminus->whmcsExceptionHandler(Object(ErrorException))
#1 {main}
thrown in /var/www/vhosts/mydomain.de/crons/cron.php on line 0
 
for me it seems it is executing the PHP file, the error is in PHP, not with the cron. If you share the PHP file content then I can say more.
 
It´s encrypted with the IonCubeLoader:

if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo("Site error: the ".(php_sapi_name()=='cli'?'ionCube':'<a href="http://www.ioncube.com">ionCube</a>')." PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.\n\nPlease visit ".(php_sapi_name()=='cli'?'get-loader.ioncube.com':'<a href="http://get-loader.ioncube.com">get-loader.ioncube.com</a>')." for install assistance.\n\n");exit(199);
?>
HR+cPyAnBShkEPJjXsMwwVM0nlTCP8qiYBiOqBB8qQPusA+8hmnN4oybj7qhczBRD07ahr/Eroch
y1IZoIYzDrdVnzH7phM90N4W8vNCBIMppFbJjjVLY8mpuL/1yga1DJV4eVuFaTiczrC1Xyabucv8
9qgmn37oLMMHgdD9WcdKeKGTCqaVHWBh07tuPNfCUFO7YhgryX1lqrwaaz8mKLE/eNuQvr15jEVv
37TA2gxAPDR5p7bYyaqtrpcB5vc0oRB4C/HzqCWIn/kn9mXw+0q8one26why78LAKQpkpbpkT2he
+RqxTl13rZwOm0SSTtvn0cElMZ/epWtnTbdBENpzYdKPNPw/hqgE4fQ72hkg4rkEbV7ejPOBN2nS
2mf9ACkck+L6Um7B8xasBaN+g9UcceUc5UkQ0880aW2709u0dm2P0980cG2Q0940cm2Q00gpmmT0
zaWSHOjpGyuSDFtVeM9+uvb98LJTOTKRH6boWiQzQ0M68whnso/p67xYL7NWO2vsbrqBe8pDVof0
maOgjQhbpYhBT6CRlXVEYkQ2K/DV3MbUowpJ0EDAguClxaBke0dwkmKpVPQa8VSwT7UFrbzDrVRf
4bbm749CxflgTkMjQjAsODhuRvMfXXTC48CgdU8ezLUyNDU+BSoSVkrVCT2yB3QJ7Prf+aoUR22O

[...]
 
OK, so for me seems that the issue is with Ioncube Loader. You will need to find out how to load Ioncube via command line. See which php.ini will load if you execute PHP and check how can you force to load a php.ini which will load Ioncube Loaders. I know there is a solution, but it is more a play/test game :)
 
Hi markusoswald,

please be aware, that PHP 7 for example has no stable ioncube loader at the moment ( only unstable and not properly working "beta" loaders ). If you use a Plesk PHP 7 version on your domain, consider to post the output of:

/opt/plesk/php/7.0/bin/php -v

and you will notice, that there is no ioncube loader installed. WHMCS for example will not work properly, if there is no ioncube loader installed with your used PHP version.


If you use any other other PHP - version, pls. always make sure, that the used PHP version has an ioncube loader installed ( see the above command and post the corresponding out from your used PHP - version - command, if you need help with the investigations!!! ), when you want WHMCS to work properly. Control as well that "/var/www/vhosts/mydomain.de/crons/config.php" has the correct, uncommented path - as for example "$whmcspath = '/var/www/vhosts/mydomain.de';" - if this is your docroot for your WHMCS - installation.
 
Hi,

thank´s for your help.
I know that PHP 7 has no ioncube modul until now, so i used PHP 6 for WHMCS.

I used WHMCS 7 beta, there is a bug in the beta v2 which will be fixed in the next release.

For everyone else, php -q will work on a stable version!
 
Back
Top