Page 1 of 1

Error using nucall_ext.php

Posted: Tue Jan 24, 2023 1:42 am
by treed
Hello, I am attempting to send an email via a cron job via the nucall_ext.php utility. The procedure I'm calling works fine inside of nuBuilder, however when called externally with
$ php -f /var/www/html/db/core/nucall_ext.php wcSendInvEmail acl_cron_job

I get this error

PHP Warning: require(./libs/phpmailer/PHPMailer.php): Failed to open stream: No such file or directory in /var/www/html/db/core/nuemailer.php on line 7
PHP Fatal error: Uncaught Error: Failed opening required './libs/phpmailer/PHPMailer.php' (include_path='.:/usr/share/php') in /var/www/html/db/core/nuemailer.php:7
Stack trace:
#0 /var/www/html/db/core/nucommon.php(7): require_once()
#1 /var/www/html/db/core/nucall_ext.php(3): require_once('...')
#2 {main}
thrown in /var/www/html/db/core/nuemailer.php on line 7

Re: Error using nucall_ext.php

Posted: Tue Jan 24, 2023 7:19 am
by kev1n
Try adding

Code: Select all

require_once ('nuemailer.php');
after

Code: Select all

require_once ('nucommon.php');
in nucall_ext.php

Re: Error using nucall_ext.php

Posted: Tue Jan 24, 2023 8:04 pm
by treed
Same message:

PHP Warning: require(./libs/phpmailer/PHPMailer.php): Failed to open stream: No such file or directory in /var/www/html/db/core/nuemailer.php on line 7
PHP Fatal error: Uncaught Error: Failed opening required './libs/phpmailer/PHPMailer.php' (include_path='.:/usr/share/php') in /var/www/html/db/core/nuemailer.php:7
Stack trace:
#0 /var/www/html/db/core/nucommon.php(7): require_once()
#1 /var/www/html/db/core/nucall_ext.php(3): require_once('...')
#2 {main}
thrown in /var/www/html/db/core/nuemailer.php on line 7

Re: Error using nucall_ext.php

Posted: Wed Jan 25, 2023 12:41 am
by kev1n
The cron job runs fine here with this config.
2023-01-25_003616.png

Re: Error using nucall_ext.php

Posted: Wed Jan 25, 2023 12:51 am
by kev1n
Also try replacing these lines in nuemailer.php

Code: Select all

require './libs/phpmailer/PHPMailer.php';
require './libs/phpmailer/Exception.php';
require './libs/phpmailer/SMTP.php';
with

Code: Select all

require __DIR__ . '/libs/phpmailer/PHPMailer.php';
require __DIR__ . '/libs/phpmailer/Exception.php';
require __DIR__ . '/libs/phpmailer/SMTP.php';

Re: Error using nucall_ext.php

Posted: Wed Jan 25, 2023 11:41 pm
by treed
Great, testing via browser got me the messages needed to resolve the issues with the command line and it now works. For those using Linux, the wget command is what's needed. I was not able to get wget to work due to Error:400. Switched to curl and added double quotes and it works!
curl "https://dbs.winecountry-bbq.com/core/nu ... l_cron_job"

Re: Error using nucall_ext.php

Posted: Wed Feb 01, 2023 9:34 pm
by treed
On word of caution, don't pass any null parameters to nusendmail. Empty strings are fine.

Re: Error using nucall_ext.php

Posted: Thu Feb 02, 2023 5:31 pm
by kev1n
For which arguments did you pass null?