Just to sum up the permissions I had to set in DCOMCNFG I have written a short
text on the subject. I am posting it here in case others need it for reference.
Since the server does not accept mails larger than 40kb I am unable to post the
Word document with snapshots of the dialogs. I hope the text alone will suffice
though.
Best regards,
Mats Bjerin
--- Here we go ---
I have been experimenting for a couple of days using the COM object to call
functions inside Word 2000. I was constantly receiving an error about a “NULL
pointer exception” when trying to instantiate the Word object using the line:
$oWord = new COM("Word.Application") or die("Unable to instantiate Word");
taken from the example application kindly provided by Alain M. Samoun.
I am running Windows 2000 SP2, PHP 4.0.6 under IIS V5.
By reading through the forums on the PHPBuilder site I finally found a reference
to the application DCOMCNFG.EXE, which sets permissions for COM and DCOM
objects, under Windows. This was to be my “salvation”.
Others seem to receive the following message indicating the same problem under
different versions of PHP:
Warning: Unable to obtain IDispatch interface for CLSID
> {000209FF-0000-0000-C000-000000000046}: Access is denied. in
> C:\Inetpub\wwwroot\website\excel\word.php on line 3
> Unable to instantiate Word
Many thanks to the following people who through their discussions and advice to
each other solved my problem:
Alan Brown <[EMAIL PROTECTED]>
Mize, Robert <[EMAIL PROTECTED]>
To make Alain’s program work fully on my server the following conditions applied
at the time of my successful tests:
· I have IIS5 installed.
· I have Office 2000 SR-1 installed (obviously with Word 2000 i.e. V9) on the
server (the client installation of Word has nothing to do with the PHP-script
executing on the server).
· I have run the program DCOMCNFG.EXE and have changed the following permissions
for the Microsoft Document object from their default settings:
- Custom Access Permissions: “Allow” the “IUSR_<servername>” user access to the
object.
- The user account to run the application: “The interactive user”
· I am using Alain’s script (my version is displayed at the end of this document
for reference) installed in the wwwroot directory on the server.
For reference I am including my copy of Alain’s program:
<?php
$sNL = "<BR>\n";
print "Hello wor(l)d!{$sNL}";
#Instantiate the Word component.
$oWord = new COM("Word.Application") or die("Unable to instantiate Word!");
#Get and print its version.
print "Loaded Word, version {$oWord->Version}{$sNL}";
#Another way to get the version using com_get.
$testversion = com_get($oWord->application,version);
print "Version using Com_get(): $testversion {$sNL}";
#Make it visible in a window.
$oWord->Visible = 1;
#Open a new document.
$oWord->Documents->Add();
#Write something.
$oWord->Selection->TypeText("This is a test...");
#Now save the document.
$oWord->Documents[1]->SaveAs("Useless test.doc");
#Comment next line if you want to see the word document,
#then close word manually.
$oWord->Quit();
print "Finished.{$sNL}";
?>
--- End of document ---
Robert Mize wrote:
> After changing the permissions using dcomcnfg.exe, it is working. I never
> knew that existed.. Thanks Alan! Also thanks to everyone else who had
> suggestions.
>
> rob.
>
> -----Original Message-----
> From: Alan Brown [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 2:19 PM
> To: Mize, Robert
> Subject: Re: [PHP-WIN] COM objects win2000 PHP4.02
>
> Probably the user account that the web site is running under (looks like
> IIS, so IUSR_<MACHINENAME>) does not have permission to instantaite the word
> component. What are the permissions on the directory containing winword.exe
> and on the exectuable itself? It could be instatitation permsisions (which
> are stored in the registry - see dcomcnfg.exe) or on the exectuable.
>
> Alan.
> ----- Original Message -----
> From: "Mize, Robert" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 28, 2001 13:29
> Subject: [PHP-WIN] COM objects win2000 PHP4.02
>
> > I am having issues instantiating word or excel using COM.
> >
> > I get the error:
> > Warning: Unable to obtain IDispatch interface for CLSID
> > {000209FF-0000-0000-C000-000000000046}: Access is denied. in
> > C:\Inetpub\wwwroot\website\excel\word.php on line 3
> > Unable to instanciate Word
> > Line 3 is:
> > $word = new COM("word.application") or die("Unable to instantiate Word");
> >
> > I have changed permissions everywhere I can think of (office executables
> and
> > web dirs), I have added com.allow_dcom = true to php.ini. I'm not sure
> > what else to try.
> >
> > Anyone know what I am doing wrong?
> >
> > Thanks,
> > rob.
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
Dear [EMAIL PROTECTED],
> BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!! > >
> Before you say ''Bull'', please read the following.>
> This is the letter > you > have been hearing about
> on the news lately. Due to> the popularity of > this
> letter on the Internet, a national weekly news>
> program recently > devoted > an entire show to the
> investigation of this program> described below, to >
> see > if it really can make people money. The show
> also> investigated whether or > not the program was
> legal. Their findings proved once and for all
> that there> are ''absolutely NO > Laws > prohibiting
> the participation in the program and if> people can
> -follow > the > simple instructions, they are bound
> to make some> mega bucks with only > $25 out of
> pocket cost''. DUE TO THE RECENT INCREASE> OF >
> POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT
> IS CURRENTLY WORKING BETTER THAN EVER. > > This is
> what one had to say: ''Thanks to this> profitable
> opportunity. I > was approached many times before
> but each time I> passed on it. I am > so glad I
> finally joined just to see what one could> expect in
> return for > the > minimal effort and money
> required. To my> astonishment, I received total
> $610,470.00 in 21> weeks, with money still coming
> in." > Pam Hedland, Fort Lee, New Jersey.
> ===================================================
> > > Here is another testimonial: "This program has
> been> around for a long > time but I never believed
> in it. But one day when I> received this again > in
> the mail I decided to gamble my $25 on it. I>
> followed the simple > instructions and walaa ..... 3
> weeks later the money> started to come in. > First
> month I only made $240.00 but the next 2> months
> after that I made > a total of $290,000.00. So far,
> in the past 8 months> by re-entering the > program,
> I have made over $710,000.00 and I am> playing it
> again. The > key to success in this program is to
> follow the> simple steps and NOT > change >
> anything.'' More testimonials later but first,
> ===== PRINT THIS NOW FOR YOUR FUTURE REFERENCE
>
>
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
> > If you would like to make at least $500,000 every
> 4> to 5 months easily > and > comfortably, please
> read the following...THEN READ> IT AGAIN and
> AGAIN!!! >
>
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
> > > FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR>
> FINANCIAL > DREAMS WILL COME TRUE, GUARANTEED!
> INSTRUCTIONS: > > =====Order all 5 reports shown on
> the list below> ===== > > For each report, send $5
> CASH, THE NAME & NUMBER OF> THE REPORT > YOU ARE
> ORDERING and YOUR E-MAIL ADDRESS to the> person
> whose > name appears ON THAT LIST next to the
> report. MAKE> SURE YOUR RETURN > ADDRESS IS ON YOUR
> ENVELOPE TOP LEFT CORNER in case> of any mail >
> problems. > > === When you place your order, make
> sure you order> each of the 5 reports. > You will
> need all 5 reports so that you can save> them on
> your computer > and resell them. YOUR TOTAL COST $5
> X 5=$25.00. > > Within a few days you will receive,
> vie e-mail, each> of the 5 reports > from > these 5
> different individuals. Save them on your> computer
> so they will be > accessible for you to send to the
> 1,000's of people> who will order them > from you.
> Also make a floppy of these reports and> keep it on
> your desk in case something happen to> your
> computer. > > IMPORTANT - DO NOT alter the names of
> the people who> are listed next > to each report, or
> their sequence on the list, in> any way other than
> what is instructed below in step> '' 1 through 6 ''
> or you will loose out on majority > of your profits.
> Once you understand the way this> works, you will
> also > see how it does not work if you change it.
> Remember,> this method has been > tested, and if you
> alter, it will NOT work !!!> People have tried to
> put > their > friends/relatives names on all five
> thinking they> could get all the > money. But it
> does not work this way. Believe us, we> all have
> tried to be greedy and then nothing> happened. So Do
> Not try to change anything other> than what is
> instructed. Because if you do, it will> not work for
> you. > > Remember, honesty reaps the reward!!! > >
> 1.... After you have ordered all 5 reports, take>
> this advertisement and > REMOVE the name & address
> of the person in REPORT #> 5. This person > has made
> it through the cycle and is no doubt> counting their
> fortune. > 2.... Move the name & address in REPORT #
> 4 down TO> REPORT # 5. > 3.... Move the name &
> address in REPORT # 3 down TO> REPORT # 4. > 4....
> Move the name & address in REPORT # 2 down TO>
> REPORT # 3. > 5.... Move the name & address in
> REPORT # 1 down TO> REPORT # 2 > 6.... Insert YOUR
> name & address in the REPORT # 1> Position. > >
> PLEASE MAKE SURE you copy every name & address>
> ACCURATELY! > >
>
==========================================================>
> > > **** Take this entire letter, with the modified
> list> of names, and save > it on your > computer. DO
> NOT MAKE ANY OTHER CHANGES. > Save this on a disk as
> well just in case if you> loose any data. To assist
> you with marketing your> business on the internet,
> the 5 reports you purchase> will provide you with
> invaluable marketing> information which includes how
> to send bulk e-mails> legally, where to find
> thousands of free classified> ads and much more. > >
> There are 2 Primary methods to get this venture>
> going: > METHOD # 1: BY SENDING BULK E-MAIL LEGALLY
> > >
>
==========================================================>
> > > Let's say that you decide to start small, just
> to> see how it goes, and we will assume You and
> those> involved send out only 5,000 e-mails each.
> Let's> also assume that the mailing receive only a
> 0.2%> response (the response could be much better
> but lets> just say it is only 0.2%. Also many people
> will send> out hundreds of thousands e-mails instead
> of only> 5,000 each). Continuing with this example,
> you send> out only 5,000 e-mails. With a 0.2%
> response, that> is only 10 orders for report # 1.
> Those 10 people> responded by sending out 5,000
> e-mail each for a> total of 50,000. Out of those
> 50,000 e-mails only> 0.2% responded with orders.
> That's=100 people> responded and ordered Report # 2.
> > > Those 100 people mail out 5,000 e-mails each for
> a> total of 500,000 > e-mails. The 0.2% response to
> that is 1000 orders> for Report # 3. > > Those 1000
> people send out 5,000 e-mails each for a> total of 5
> million > e-mails sent out. The 0.2% response to
> that is> 10,000 orders for Report # 4. > > Those
> 10,000 people send out 5,000 e-mails each for> a
> total of 50,000,000 (50 million) e-mails. The 0.2%>
> response to that is 100,000 orders for Report # 5 >
> > THAT'S 100,000 ORDERS TIMES $5 EACH=$500,000.00>
> (half million). > > Your total income in this
> example is: 1..... $50 +> 2..... $500 + 3..... >
> $5,000 + 4 > .. $50,000 + 5..... $500,000 ........
> Grand> Total=$555,550.00 > > NUMBERS DO NOT LIE. GET
> A PENCIL & PAPER AND> FIGUREOUT > THE WORST POSSIBLE
> RESPONSES AND NO MATTER HOW YOU > CALCULATE IT, YOU
> WILL STILL MAKE A LOT OF MONEY ! > >
>
=========================================================>
> REMEMBER FRIEND, THIS IS ASSUMING ONLY 10 PEOPLE
> ORDERING OUT OF 5,000 YOU MAILED TO. > Dare to
> think for a moment what would happen if> everyone or
> half or even > one 4th of those people mailed
> 100,000e-mails each> or more? There are > over 150
> million people on the Internet worldwide> and
> counting. Believe > me, > many people will do just
> that, and more! > METHOD # 2 : BY PLACING FREE ADS
> ON THE INTERNET > >
>
=======================================================>
> Advertising on the net is very, very inexpensive
> and> there are hundreds > of FREE places to
> advertise. Placing a lot of free> ads on the
> Internet > will easily get a larger response. We
> strongly> suggest you start with Method # 1 and add
> METHOD # 2> as you go along. For every $5 you
> receive, all you> must do is e-mail them the Report
> they ordered.> That's it. Always provide same day
> service on all> orders. > This will guarantee that
> the e-mail they send out,> with your name and >
> address on it, will be prompt because they can not>
> advertise until they > receive the report. > >
> =========== AVAILABLE REPORTS ==================== >
> > ORDER EACH REPORT BY ITS NUMBER & NAME ONLY.
> Notes: > Always send $5 cash (U.S. CURRENCY) for
> each Report.> Checks NOT > accepted. Make sure the
> cash is concealed by> wrapping it in at least 2 >
> sheets > of paper. On one of those sheets of paper,
> Write the> NUMBER & the NAME > of the Report you are
> ordering, YOUR E-MAIL ADDRESS> and your name > and
> postal address. > > PLACE YOUR ORDER FOR THESE
> REPORTS NOW : > >
>
====================================================>
> > REPORT # 1: "The Insider's Guide to Advertising
for Free on the Net" > Order Report #1 from:
> W.L. Hassell
> P.O. Box 6112
> Spokane WA, 99217-0902
> >
>
___________________________________________________________>
> > REPORT # 2: "The Insider's Guide to Sending Bulk
> e-mail on the Net" > Order Report # 2 from:
> W.K. Bowen
> 18330 N 79th ave #2138
> Glendale AZ,
> 85308-8363> >
>
____________________________________________________________>
> > REPORT # 3: "Secret to Multilevel Marketing on
> the Net" > Order Report # 3 from :
> M.G.
> 7143 Hillside Dr.
> W. Bloomfield, MI 48322-2847, USA
>
__________________________________________________________>
> > REPORT # 4: "How to Become a Millionaire
> Utilizing> MLM & the Net" > Order Report # 4 from:
> K.C.
> 7143 Hillside Dr.
> W. Bloomfield, MI 48322-2847
>
____________________________________________________________>
> > REPORT #5: "How to Send Out 0ne Million e-mails
> for Free" > Order Report # 5 from:
B. M.
4510 Meadow Way
White Lake, MI 48383-1816
>
___________________________________________________________>
> > $$$$$$$$$ YOUR SUCCESS GUIDELINES $$$$$$$$$$$ > >
> Follow these guidelines to guarantee your success: >
> > === If you do not receive at least 10 orders for>
> Report #1 within 2 > weeks, continue sending e-mails
> until you do. > === After you have received 10
> orders, 2 to 3 weeks> after that you > should
> receive 100 orders or more for REPORT # 2. If> you
> did not, > continue advertising or sending e-mails
> until you> do. > === Once you have received 100 or
> more orders for> Report # 2, YOU > CAN RELAX,
> because the system is already working for> you, and
> the > cash will continue to roll in ! THIS IS
> IMPORTANT TO> REMEMBER: > Every time your name is
> moved down on the list, you> are placed in front >
> of a Different report. > You can KEEP TRACK of your
> PROGRESS by watching> which report > people are
> ordering from you. IF YOU WANT TO> GENERATE MORE >
> INCOME SEND ANOTHER BATCH OF E-MAILS AND START > THE
> WHOLE PROCESS AGAIN. > There is NO LIMIT to the
> income you can generate> from this business !!! > >
>
======================================================>
> > > FOLLOWING IS A NOTE FROM THE ORIGINATOR OF THIS
> > PROGRAM: You have just received information that
> can> give you > financial freedom for the rest of
> your life, with NO> RISK and JUST > A LITTLE BIT OF
> EFFORT. You can make more money in> the next > few
> weeks and months than you have ever imagined.>
> Follow the program > EXACTLY AS INSTRUCTED. Do Not
> change it in any way.> It works > exceedingly well
> as it is now. > Remember to e-mail a copy of this
> exciting report> after you have put > your name and
> address in Report #1 and moved others> to #2
> ...........# 5 > as instructed above. One of the
> people you send this> to may send out > 100,000 or
> more e-mails and your name will be on> every one of
> them. > Remember though, the more you send out the
> more> potential customers > you will reach. > So my
> friend, I have given you the ideas,> information,
> materials and > opportunity to become financially
> independent. IT IS> UP TO YOU NOW ! > > ============
> MORE TESTIMONIALS ================ > > "My name is
> Mitchell. My wife, Jody and I live in> Chicago. I am
> an > accountant with a major U.S. Corporation and I
> make> pretty good money. > When I received this
> program I grumbled to> Jodyaboutreceiving ''junk >
> mail''. I made fun of the whole thing,spoutingmy>
> knowledge of the > population > and percentages
> involved. I ''knew'' it wouldn't> work. Jody totally
> > ignored > my supposed intelligence and few days
> later she> jumped in with both feet. > I > made
> merciless fun of her, and was ready to lay the> old
> ''I told you so'' > on > her when the thing didn't
> work. Well, the laugh was> on me! Within 3 weeks >
> she had received 50 responses. Within the next 45>
> days she had received > total $ 147,200.00
> ........... all cash! I was> shocked. I have joined
> > Jody > in her ''hobby''. > Mitchell Wolf M.D.,
> Chicago, Illinois > >
>
======================================================>
> > > ''Not being the gambling type, it took me
> several> weeks to make up my > mind to participate
> in this plan. But conservative> that I am, I decided
> > that > the initial investment was so little that
> there was> just no way that I > wouldn't get enough
> orders to at least get my money> back''. '' I was >
> surprised when I found my medium size post office>
> box crammed with > orders. I made $319,210.00in the
> first 12 weeks. The> nice thing about > this deal is
> that it does not matter where people> live. There
> simply > isn't a > better investment with a faster
> return and so big." > Dan Sondstrom, Alberta, Canada
> > >
>
=======================================================>
> > > ''I had received this program before. I deleted
> it,> but later I wondered > if I should have given
> it a try. Of course, I had no> idea who to contact >
> to > get another copy, so I had to wait until I was>
> e-mailed again by someone > else.........11 months
> passed then it luckily came> again...... I did not >
> delete this one! I made more than $490,000 on my>
> first try and all the > money came within 22 weeks."
> > Susan De Suza, New York, N.Y. > >
>
=======================================================>
> > > ''It really is a great opportunity to make>
> relatively easy money with > little cost to you. I
> followed the simple> instructions carefully and >
> within 10 days the money started to come in. My>
> first month I made > $20,560.00 and by the end of
> third month my total> cash count was > $362,840.00.
> Life is beautiful, Thanx to internet.".> > Fred
> Dellaca, Westport, New Zealand > >
>
=======================================================>
> > ORDER YOUR REPORTS TODAY AND GET STARTED ON >
> 'YOUR' ROAD TO FINANCIAL FREEDOM ! >
>
=======================================================>
> > > If you have any questions of the legality of
> this> program, contact the > Office of Associate
> Director for Marketing> Practices, Federal Trade >
> Commission, Bureau of Consumer Protection,>
> Washington, D.C. > > > (Note: To avoid delays make
> sure appropriate postage> to Canada is applied > if
> mailing from the US) > >
>