Help - Search - Members - Calendar
Full Version: shell_exec & windows
Invision Power Services > Community Forums > Community Web Design and Coding
Luke
I'm trying to do execute a command line app with shell_exec, and I cant get it to work on my windows box. When I execute, nothing is returned. Yet, when I execute it from command prompt (manually typing it), it works just fine.

I'm pretty sure it will work alright in Linux, but I need to make this work on my Windows box... I have the program setup on both the linux server and on my windows xp machine with enviromental variables (meaning it can be accessed anywhere in command line).
sbauer
Make sure the user has rights to execute the program.
Trel
I think the problem stems from the fact that if it doesn't pause for some reason, windows auto closes the command prompt dialog.
Luke
Actually, it turns out I needed to restart the computer original.gif. The shell_exec command didnt pick up the change on the enviromental variables, but the command prompt did, before the restart.
Brendon Koz
If it's quicker, for future reference, I think a logoff/logon would have also updated the environmental variables as they can sometimes be user-specific. Not sure though, haven't tested it.
Luke
I think what's weird is command prompt (cmd) picked them up immediatly, but php didnt. blink.gif. I even tried restarting Apache and that didnt work... Took a full system restart.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.