I'm trying to get a pdf generator on my intranet portal. They would like to see the link on all pages. I've gotten a test file up running, but when I try to feed live site information I get a memory error
The file I'm hitting with the browser is test.php
The file it calls out to is pmap.php which contains a simple program to pull the devices that are in the database to be monitored. The query returns 91 rows of information
The pmap.php page loads in the browser fine. I've actually changed out to a few different files and received the same error, this sample is the shortest code for posting.
I am setting the memory to 24MB using ini_set in my script. The browser is actually reporting that it sees that full amount and has only allocated 98kb.. So I'm not sure how to resolve this.
Has any one come across this before? Any suggestions on resolving?
Thank you,
"If the only prayer you said in
your whole life was, 'thank you,'
that would suffice."
-- Meister Eckhart
browser said:Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 98304 bytes) in C:\Program Files\Apache Group\Apache2\htdocs\v1\scripts\pdf\include\inline_renderer.cls.php on line 141
The file I'm hitting with the browser is test.php
Code:
<?php
require_once("./scripts/pdf/dompdf_config.inc.php");
ini_set("memory_limit","24M");
$file = "pmap.php";
ob_start();
include($file);
$html = ob_get_clean();
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>
The file it calls out to is pmap.php which contains a simple program to pull the devices that are in the database to be monitored. The query returns 91 rows of information
Code:
<?
set_time_limit(300);
define('ENTRYPOINT', TRUE);
require_once('./datadip/dbinfo.php');
define('APPTITLE', '');
define('PMDUMP', "
select pm.PeripheralMapID
, pm.SystemServerName, pm.SystemServerAlias
, pm.PeripheralID, pm.PhysicalControllerID
, pm.AppGatewayID, pm.PeripheralDescription
from Peripheral_Map pm
join Customer cu on (pm.CustID = cu.CustID and cu.ActiveFlag = 1)
order by pm.PeripheralMapID asc");
$pmdump = array();
$conn = mssql_connect($strdbalias, $strdbuid, $strdbpwd) or exit('unable to connect to the database service');
mssql_select_db($eventdb, $conn) or exit("unable to select the $eventdb database");
$result = mssql_query(PMDUMP, $conn) or exit('unable to run peripheral map export query');
while ( FALSE !== ($r = mssql_fetch_row($result)) ) $pmdump[] = $r;
mssql_close($conn);
function dumphead() {
echo "<tr>\n";
echo "<th>Peripheral<br />Map<br />ID</th>\n";
echo "<th>System<br />Server<br />Name</th>\n";
echo "<th>System<br />Server<br />Alias</th>\n";
echo "<th>Peripheral<br />ID</th>\n";
echo "<th>Physical<br />Controller<br />ID</th>\n";
echo "<th>Application<br />Gateway<br />ID</th>\n";
echo "<th>Peripheral<br />Description</th>\n";
echo "</tr>\n";
}
function dumprow( $r ) {
echo "<tr>\n";
foreach ($r as $k => $v ) {
if ( is_null($v) || $v == '' ) {
$v = ' ';
$c = 'null';
} else {
$c = 'dfnd';
}
echo "<td class='$c'><a href='topAlerts.php'>$v</a></td>\n";
}
echo "</tr>\n";
}
?>
<html><head><title><?= APPTITLE ?></title><style type="text/css">
<!--
BODY {font-family: verdana; font-size: 8pt; background-color: #fdfffc; margin: 0;}
TABLE {font-family: verdana; margin: 0;}
TH {font-family:sanserif; font-style:normal; font-weight:bold; font-size:12pt; color:000000; background-color:ACB6AB}
TD {font-family: sanserif; font-style:normal; font-weight: normal; font-size:9pt; color:000000; background-color:FFFFFF }
TD.null {background-color: #ACB6AB;}
TD.dfnd {background-color: #FFFFFF;}
-->
</style></head><body><div align='center'>
<span style='font-size: 16pt; font-weight: bold;'><?= APPTITLE ?></span>
<table border='1' cellspacing='0' cellpadding='3'>
<?
if ( count($pmdump) > 0 ) {
dumphead();
foreach ( $pmdump as $k => $v )
dumprow($pmdump[$k]);
} else {
echo "<tr>\n";
echo "<td class='null'>The devices list does not contain any valid records at this time.</td>\n";
echo "</tr>\n";
}
?>
</table>
</div></body></html>
The pmap.php page loads in the browser fine. I've actually changed out to a few different files and received the same error, this sample is the shortest code for posting.
I am setting the memory to 24MB using ini_set in my script. The browser is actually reporting that it sees that full amount and has only allocated 98kb.. So I'm not sure how to resolve this.
Has any one come across this before? Any suggestions on resolving?
Thank you,
"If the only prayer you said in
your whole life was, 'thank you,'
that would suffice."
-- Meister Eckhart