Welcome to the nuBuilder Forums!

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

nurunpdf.php not found 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:

nurunpdf.php not found

Unread post by treed »

Running php8 and trying to use nuRunReportSave with this line of javascript.

Code: Select all

nuRunReportSave('InvoiceRpt');

Nothing happens on screen and no errors in console however the apache log shows.
[Thu Feb 02 15:34:31.181674 2023] [proxy_fcgi:error] [pid 21978] [client 192.52.251.253:58852] AH01071: Got error 'PHP message: PHP Warning: unlink(): No such file or directory in /var/www/html/db/core/nurunpdf.php on line 1172', referer: https://dbs.winecountry-bbq.com/index.php

nurunpdf.php exists in that location. Any ideas?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nurunpdf.php not found

Unread post by kev1n »

nuRunReportSave() simply saves a pdf to the temp directory. Do you see it there?
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nurunpdf.php not found

Unread post by treed »

No, I don't have the entry in temp_pdf either. What I'm reading is that unlink() is very picky about paths and does not like relative paths. The path is good because.

Code: Select all

wcbbq-cloud@wcbbq2:~$ dir /var/www/html/db/core/nurunpdf.php
/var/www/html/db/core/nurunpdf.php
This is possibly a php8 thing because this code did work before I upgraded.
https://stackoverflow.com/questions/430 ... -directory
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nurunpdf.php not found

Unread post by kev1n »

I tested with both Linux and Windows and both times the file is generated and saved in nuBuilder's \temp directory

- Apache/2.4.54 (Debian), PHP version: 8.2.2
- Apache/2.4.51 (Win64), PHP version: 8.1.0
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nurunpdf.php not found

Unread post by kev1n »

If the file is not even saved in the Temp directory, there is obviously another problem.

Add

Code: Select all

nuDebug($path);
After the line $path = realpath($dir); in nurunpdf.php and check the debug results to inspect where the file is saved to.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nurunpdf.php not found

Unread post by treed »

Ah, that flushed up that it was a permissions error. Issue resolved. Thank you!
Post Reply