Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Error using nucall_ext.php Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Error using nucall_ext.php

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Error using nucall_ext.php

Unread post by kev1n »

Try adding

Code: Select all

require_once ('nuemailer.php');
after

Code: Select all

require_once ('nucommon.php');
in nucall_ext.php
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Error using nucall_ext.php

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Error using nucall_ext.php

Unread post by kev1n »

The cron job runs fine here with this config.
2023-01-25_003616.png
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Error using nucall_ext.php

Unread post 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';
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Error using nucall_ext.php

Unread post 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"
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Error using nucall_ext.php

Unread post by treed »

On word of caution, don't pass any null parameters to nusendmail. Empty strings are fine.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Error using nucall_ext.php

Unread post by kev1n »

For which arguments did you pass null?
Post Reply