Can"t execute external program -> error "Access is denied"

Can"t execute external program -> error "Access is denied"

am 19.06.2007 15:01:56 von Davide Molteni

Hi,

I've a Windows 2003 server, running Apache 2.2 with PHP 4.4.4 and I want
to run an external program or script with exec(), passthru(),
shell_exec() or system() but I always receive "Access is denied".
If I try with "notepad.exe" it works!
This program or script works if I run it from the Windows Command line.

Any idea?

Thanks a lot for your help.

Regards

Dave

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Can"t execute external program -> error "Access is denied"

am 19.06.2007 18:34:25 von hSiplu

Hello Dave,

It happens for the different privileges of php executer.
When you run php as a module by Apache. Apache runs under a user which has
no privilege to run those system specific command. You can see error log of
apache.
When you run it yourself from command prompt, you are the executer who has
those privileges.
I don't know why "notepad.exe" works. may be there is some other issue.

Shiplu

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: Can"t execute external program -> error "Access is denied"

am 19.06.2007 18:54:16 von Niel Archer

Hi

> I don't know why "notepad.exe" works. may be there is some other issue.

Probably because Notepad has execute permission for the LOCAL_SYSTEM
account, and Apache/PHP is probably running using that account.


Niel

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php