note 91161 added to book.com
| From: | DaveBachtel at osu1 dot php dot net | Date: | Wed, 27 May 2009 21:20:55 +0000 |
| Subject: | note 91161 added to book.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156093@lists.php.net to get a copy of this message | ||
Hello everybody!
Here is some helpful advice for people attempting to use COM with Microsoft MapPoint 2006 or 2009
with PHP.
If you are using apache, it MUST be running under the same credentials as a desktop user that has
already installed/run mappoint or modifiy the service and select the "Allow Service to Interact
with Desktop" option. Otherwise, it won't work due to the EULA popup having to be
accepted. Mappoint 2004 works just fine, this only applies to 2006 and 2009.
For troubleshooting, the error that appears in the System event viewer is:
The server {31851F82-AFE6-11D2-A3C9-00C04F72F340} did not register with DCOM within the required
timeout.
The error generated by PHP, if you happen to get lucky and let the COM() function timeout by
cranking up set_time_limit() timeout is:
<?php
set_time_limit(1000) ;
$mapoint = new COM("MapPoint.Application") or die("Unable to instantiate Mappoint
COM object");
?>
Generates:
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM
object `MapPoint.Application': Server execution failed ' in [somefile.php]:9 Stack trace:
#0 [somefile.php](9): com->com('MapPoint.Applic...') #1 {main} thrown in [somefile.php]
on line 9
Also, if you have multiple versions of MapPoint installed, you will need to run:
c:\path\to\mappoint\MapPoint.exe /registerserver
(using the correct folder path) to select the right version of the com object to use. Gooood luck!
----
Server IP: 208.69.120.35
Probable Submitter: 97.81.100.17
----
Manual Page -- http://www.php.net/manual/en/book.com.php
Edit -- https://master.php.net/note/edit/91161
Del: integrated -- https://master.php.net/note/delete/91161/integrated
Del: useless -- https://master.php.net/note/delete/91161/useless
Del: bad code -- https://master.php.net/note/delete/91161/bad+code
Del: spam -- https://master.php.net/note/delete/91161/spam
Del: non-english -- https://master.php.net/note/delete/91161/non-english
Del: in docs -- https://master.php.net/note/delete/91161/in+docs
Del: other reasons-- https://master.php.net/note/delete/91161
Reject -- https://master.php.net/note/reject/91161
Search -- https://master.php.net/manage/user-notes.php