Note Submitter: pyesley at yahoo dot co dot uk
----
Problem: I could not get exec("myprogram.exe") to run a executable file. I could see the myprogram.exe launch into the Task Manager, but then the .php script would hang.
I tried system(), and launching .bat files. Nothing worked.
System: I'm running windows XP SP2, with Apache.
Solution:
Change the user associated with apache. The process httpd.exe was running as the user: SYSTEM. I changed it to run under a different user, (me). Now perhaps this isn't great for security, but it does work.
To do this go to Control Panel->Administrative Tools->Services.
Find the Apache Service and stop it. Right click to bring up it's properties. Go to the LogOn tab And change the service to run under a different account. You have to add a password. It didn't work when I put it to an account without a password.
Then restart the service Apache. Check in the task manager to see that httpd.exe is not running under the user SYSTEM but rather a new user with lots of privileges.
Now exec(myprogram.exe) will launch and execute myprogram.exe.
Maybe another user can tell me what security options I should use to keep this solution without sacrificing too much security.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.