Welcome to the nuBuilder Forums!

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

Report Designer PHP Error Topic is solved

Questions related to nuBuilder Forte Reports and the Report Builder.
Post Reply
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Report Designer PHP Error

Unread post by vario »

I cannot edit layout of some reports as I get a blank page in Report Designer and a PHP error at the server:

Code: Select all

[Sat Feb 15 11:27:37.393068 2025] [php:error] [pid 37201:tid 37201] [client 192.168.1.34:57166] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 106955480 bytes) in /var/www/forte/core/nucommon.php(1471) : eval()'d code on line 35, referer: https://myhostname/forte/index.php
I have tried increasing memory_limit in php.ini from its value of 128M up to 1024M but still get the same error though the size of allocation increases:

Code: Select all

[Wed Feb 12 19:51:10.002016 2025] [php:error] [pid 38893:tid 38893] [client 192.168.1.34:47182] PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 534774264 bytes) in /var/www/forte/core/nucommon.php(1471) : eval()'d code on line 45, referer: https://myhostname/forte/index.php
I'm not sure what has changed to cause this. Here's my "Version Info:

Database: Arch Linux 11.7.2-MariaDB
PHP: 8.4.3
nuBuilder DB: V.4.5-2024.06.08.00
nuBuilder Files: V.4.5-2024.06.08.04

Neil.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Report Designer PHP Error

Unread post by kev1n »

Hi,

This could either be due to the used PHP version (try an older version) or update nuBuilder, which uses newer versions of TCPDF.
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: Report Designer PHP Error

Unread post by vario »

Have upgraded but the PHP error persists.

I don't want to downgrade my PHP so will put up with old report layout temporarily until a solution can be found!

EDIT: The report uses a procedure to make the report table and this is the cause of the error somehow. I replaced the report procedure with a nuSQL table - then I was able to edit the layout with Report Designer, and switch back to the procedure. So some progress at least!
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: Report Designer PHP Error

Unread post by vario »

I have managed to find the problem. There is a "for" in the procedure which is being run until memory is exhausted. Nothing wrong with the code I think (other than the usual stylistic objections) as it runs perfectly well as a report, just the eval() before launching Report Designer appears to be causing this.

Code: Select all

for ($yr = $toYr; $yr >= $fromYr; $yr--) $sql .= " union all " . str_replace('?', 'ticket_' . $yr, $usql);
$fromYr and $toYr take their values from hash variables.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Report Designer PHP Error

Unread post by kev1n »

The information provided is somewhat vague because it doesn't specify the actual values of $fromYr and $toYr. To debug this, use nuDebug() to inspect their values and ensure they are properly initialised.
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: Report Designer PHP Error

Unread post by vario »

They have no values yet, I am trying to open the Report Designer so why is the loop even running?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Report Designer PHP Error

Unread post by kev1n »

The report builder can use a table, Nu-SQL, or a procedure as its data source. It relies on the underlying SQL to determine the available fields.

Since you're using a procedure, ensure that it runs without loops. If variables are initialised via Hash Cookies, make sure they are also initialised when no Hash Cookies are set (E.g. check if a HK is set and if not, use a default value)
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: Report Designer PHP Error

Unread post by vario »

OK thanks, all sorted now. My first time using a loop in a report procedure!
Post Reply