1

I have a Windows 2008 server with PHP and msys installed. I also have a simple php script that calls shell_exec and tars a few files. When I run the script on my development machine (Windows 7), it works fine. However, when I run it on the Windows 2k8 server, it times out. When I copy and paste exactly what's being run on the cmd line and run it, it executes w/out error in less than a second.

One more important detail: when I shell_exec 'dir' or 'netstat', the script runs without any problems. When I shell_exec 'ls' it hangs. When I run ls on the command line, it returns immediately.

Other details that might be useful: The Windows 2k8 server is a VPS hosted by Rackspace. I did vanilla installs of Apache, PHP, and msys, but I haven't installed anything else.

When I run whoami, I see the php script is executing as the user "nt authority\system".

1
  • Have you checked permissions to make sure the System account can access all of the necessary folders? Commented Apr 22, 2010 at 13:20

1 Answer 1

0

It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.

If its not environment, just start double checking permissions.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.