Joe, I am not answering your question - I have the same problem and am hoping to get some help. I am having the same problem using PHP and mapscript. I am able to open a file for reading and writing from PHP in the temporary folder, but always get the error "unable to open file for writing" when using the same directory with mapscript. If I eliminate the path in the 'image->save' command then the image is written to the 'cgi-bin' directory successfully. This location is not where we would like to read and write files from. I assume there is just some setting that I have missed that would allow writing to the temporary folder. We have the alias to that folder defined in the apache conf file.
I have the same question that Joe has. Is there something else I need to do? Bruce Cheney -----Original Message----- From: UMN MapServer Users List [mailto:[EMAIL PROTECTED] On Behalf Of Joe Bussell Sent: Wednesday, July 05, 2006 11:19 AM To: [email protected] Subject: Re: [UMN_MAPSERVER-USERS] PERL interface trouble Thank you! I have mode some progress. The fact that my fonts/ directory was not readable escaped my notice. The msGetErrorString function provided that data right away. I have still have some undesired behavior however. I added $img->save( $outfile ); carp mapscript::msGetErrorString("\n"); And it indicates that my image file is not openable for write. I have verified that the entire directory chain indicated in the message is world writable. Is there something else that I need to do? [Mon Jul 3 15:52:17 2006] -e: Failure: msSaveImageGD(): Unable to access file. Unable to open file /usr/routing/routes/Route1151967137028128.223.40.5.png for writing at /usr/routing/perl/dwarp/mapdrawing.pm line 515 I changed my write directory to be a child of /tmp, and everything worked out just fine. I verified that the directory permissions matched and could not find any reference in my httpd.conf that would preclude writing to a directory off of /usr. Any ideas as to why this is? Joe Bussell On Time Systems Steve Lime wrote: > You can get at the MapServer error stack with a call like: > > my $map = new mapscript::mapObj( $mapfile ) or > mapscript::msGetErrorString("\n"); > > That may help, or be something to try. I use perl MapScript with 4.8 and the CVS version all the time with good results. > > Steve > > >>>>Joseph Bussell <[EMAIL PROTECTED]> 6/30/2006 2:09:06 PM >>> > > Does anyone use the latest code with PERL Mapscript? If shp2img works > with my mapfile, is there anything else I can do to understand why my > new call for the mapObj fails? > > Joe Bussell > On Time Systems > > > Joseph Bussell wrote: > > >>I have verified that shp2img constructs an image that derives form my >>mapfile. This part looks good. My mapscript code was written for >>4.4.2, but the one function that is failing does not appear to have >>significantly changed. I am not getting past construction of the >>basic mapObj from the mapfile. Specifically, the call to : >> >>my $map = new mapscript::mapObj( $mapfile ) or carp "Could not create >>mapscript object from mapfile: $mapfile"; >> >>produces the error message. I also went into mapscript.pm and added >>debug code there to be sure I was using the correct module. The low >>level call is producing an unusable result. >>Joe Bussell >>On Time Systems >> >> >>Stephen Woodbridge wrote: >> >> >>>Hi Joe, >>> >>>A couple of things. >>> >>>1) what version does you existing code work on? >>>2) There are probably two areas that you will need to change >>> a) the mapfile >>> b) the perl >>> >>>I would start with using shp2img to make sure you mapfile can load. >>>It will at least print errors that you can read. >>> >>>shp2img -m /path/to/file.map -o junk.png ... >>> >>>Once you can get an image then you will probably have more luck >>>tracking down the various mapscript changes. These will depend on >>>what version of mapscript your code was written for. >>> >>>-Steve W. >>> >>>Joseph Bussell wrote: >>> >>> >>>>Greetings Listers, >>>> It has been a while since I deployed a new Mapserver application. >>>>I have been leaning on old source on an old box to get the work >>>>done. I have been given a new server to set up for our Air Force >>>>project and have had some issues with getting my code to work. >>>>First of all I am using Mapscript ala PERL. I recognize that the >>>>PERL interface has not been updated due to a lack of user interest, >>>>but I am still partial to using it if it can still be done (mostly >>>>since I will not have to rewrite my routing path functionality). >>>> >>>> My problem is getting the actual mapObj to construct from my >>>>mapfile. I have not been able to get any debug information our by >>>>checking /tmp/mserrors, which used to work nicely in such cases. >>>>All I get is an undefined reference. My code for construction is >>>>simple: >>>> >>>>my $map = new mapscript::mapObj( $mapfile ) or carp "Could not >>>>create mapscript object from mapfile: $mapfile"; >>>> >>>>in my httpd.conf I define >>>>MS_ERRORFILE /tmp/mserrors.txt >>>> >>>>My mapfile exists and is very simple. >>>>I am running: >>>>CentOS release 4.3 >>>>AMD64, dual core machine >>>>Apache/2.0.52 >>>>mapserver-4.8.3.tar.gz >>>>perl, v5.8.5 built for x86_64-linux-thread-multi >>>> >>>>Thank you for your time. >>>> >>>>Joe Bussell >>>>On Time Systems >>>> >>> >>> >
