exec not working on Windows 2008

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
spooky27
Forum Newbie
Posts: 2
Joined: Tue Nov 16, 2010 8:08 am

exec not working on Windows 2008

Post by spooky27 »

Hi,

I am trying to use the exec function via PHP code to execute a dos executable. Its working fine when i run the exact same code on Windows XP but there is no output on Windows 2008 server. Also, there is no error. The code looks something like:

exec('testbatch.bat");

I am using WAMP on Windows 2008. Strangely, there is no error or anything else in the apache log either. What could be the problem ? Is it a permission issue specific to Windows 2008 (exact same code works on Win Xp) ?

Please help!

Chetan
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: exec not working on Windows 2008

Post by s992 »

Server 2008 is really finicky with permissions, you should verify that you are running as administrator and that UAC is turned off.
spooky27
Forum Newbie
Posts: 2
Joined: Tue Nov 16, 2010 8:08 am

Re: exec not working on Windows 2008

Post by spooky27 »

thanks for your response s992.

what is UAC and how can i check if its turned off ?
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: exec not working on Windows 2008

Post by s992 »

UAC is the bane of all things good and holy.

I found this article to be a good resource for explaining what UAC is and how to turn it off.
Post Reply