Script with COM works from command line but no from browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marcpeterson
Forum Newbie
Posts: 2
Joined: Wed Aug 24, 2005 2:05 am

Script with COM works from command line but no from browser

Post by marcpeterson »

I have a very simple script calling a COM dll that I registered with regsvr32. Using a browser, the php script crashes. But if I use the command line and type c:\php.exe c:\path to script\script.php then it works fine. It also works fine from the browser if run on other systems with php installed.

I'm using Windows XP Pro with IIS and PHP ver 4.4.0.

I'm guessing it's an issue with the COM object and the account used to call it...? Anyone have any ideas? Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Re: Script with COM works from command line but no from brow

Post by feyd »

marcpeterson wrote:I'm guessing it's an issue with the COM object and the account used to call it...?
those would be my guess too, the latter more than the former though.
marcpeterson
Forum Newbie
Posts: 2
Joined: Wed Aug 24, 2005 2:05 am

Post by marcpeterson »

Any idea how I change the account used to access COM objects through php? I'm thinking it's the php executable or dll itself that is getting run under the wrong account (since doing it from the command line works).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

most often, php is run under the user that owns the web server process.
Post Reply