Luke
Mar 15 2006, 12:53 AM
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
Mar 15 2006, 02:41 AM
Make sure the user has rights to execute the program.
Trel
Mar 15 2006, 03:59 AM
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
Mar 15 2006, 05:16 AM
Actually, it turns out I needed to restart the computer

. The shell_exec command didnt pick up the change on the enviromental variables, but the command prompt did, before the restart.
Brendon Koz
Mar 15 2006, 05:48 AM
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
Mar 15 2006, 06:26 AM
I think what's weird is command prompt (cmd) picked them up immediatly, but php didnt.

. 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.