Opened 12 years ago

Closed 12 years ago

#1887 closed defect (fixed)

QuickPlot + MapGuide 2.3 (SVN)

Reported by: wrees Owned by:
Priority: low Milestone: 2.4
Component: AJAX Viewer Version:
Severity: major Keywords: quickplot exceed settings defined by administrator mapguide 2.3
Cc: External ID: 1415610

Description

I've been trying to get the new quickplot feature working in MapGuide 2.3 SVN. I kept running into the dreaded:

The application resources required to generate the plot exceed the settings defined by the administrator

I checked to make sure that PHP was compiled with gd, etc and everything was fine on that end. I'm using the php viewer, and after a bunch of digging I found the culprit.

Line 119 of mapviewerphp/quickplotgeneratepicture.php

$tempImage = sys_get_temp_dir() . uniqid();

this makes $tempImage as "/tmp4ee7858739161" causing it to fail to create the file.

A better solution would be to use tempnam() in conjunction with sys_get_temp_dir.

Line 119 of mapviewerphp/quickplotgeneratepicture.php turns into:

$tempImage = tempnam(sys_get_temp_dir, "mgo");

Can you please add this fix to the SVN trunk.

Thanks!

Warren

Attachments (3)

quickplotgeneratepicture.patch (561 bytes ) - added by wrees 12 years ago.
Patch for quickplotgeneratepicture.php
quickplot_tempfile_patch_fusion.patch (582 bytes ) - added by wuma 12 years ago.
quickplot_tempfile_patch.patch (601 bytes ) - added by wuma 12 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by wrees, 12 years ago

you could also fix it by changing it to:

sorry it should read:

$tempImage = tempnam(sys_get_temp_dir(), "mgo");

comment:2 by wrees, 12 years ago

Sorry it should read

$tempImage = tempnam(sys_get_temp_dir(), "mgo");

comment:3 by zspitzer, 12 years ago

Nice work, can you create and attach a patch for this?

Also, it's best to post a quick message to mapguide-internals after filing a ticket

by wrees, 12 years ago

Patch for quickplotgeneratepicture.php

comment:4 by wuma, 12 years ago

From my test, tempnam() doesn't work with PHP 5.3.8 + IIS7. That means we cannot fix the problem by tempnam(). We might simply add the path separator before uniqueid(): $tempImage = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "mgo" . uniqid(); The code would work for both Windows and Linux.

by wuma, 12 years ago

comment:5 by wuma, 12 years ago

External ID: 1415610

comment:6 by wuma, 12 years ago

Milestone: 2.32.4
Resolution: fixed
Status: newclosed

Basic: r6375

Fusion: r2499

Note: See TracTickets for help on using tickets.