Php shell_exec windows not working




















Thanks for any help, John. January Also, all of these work from the command line. January So I made some progress. Following the recommendation by rymfaxe on the PHP documentation website for the "Program Execution Functions" one level up from System , exec , etc.

It appears I am having some sort of syntax, or other difficulty with my pdftk command though since it's telling me: The filename, directory name, or volume label syntax is incorrect. Still working on that. January Hi John, Glad to hear that you are making progress. I did not realise you were runnung apache as a service - I run with manual start, not as a service so explains why the paint script worked for me but not for you.

Now that you have allowed apache to interact with the desktop the paint script works - this is not needed if you run apache direct as i am. As you say it looks like a syntax problem. Try this - Code: Select all system "pdftk" ; or pdftk. When you can get this to work without errors add the rest of the arguments. The big issue was setting the apache service correctly in services.

This causes the error "The filename, directory name, or volume label syntax is incorrect. A solution is to force a clean environment. This happens on both Linux and Windows. I finally isolated the problem to changes that Eclipse makes to the environment when debugging. The fix is to force the ini setting.

If you don't need an ini then -n is sufficient. You may want to use a debug flag to control this behavior. Empty string. It's interesting how shell command execution can get down to how nuanced one might need to be with string parsing. Other wise, it won't appear to be doing anything. I would recommend using the sysinternals Process Monitor 'procmon. Filter on 'Process Name' is 'php-cgi. Look at the event properties for the task with the access denied error, and it will show you the 'Impersonating' user name.

Hope this helps someone. Even with a hard-coded full path to a binary, I also got an error about a. The technique mentioned by Nathan De Hert below is rather insecure -- you should never leave a password lying around in a file readable by the apache user.

It's a little extra configuration, but much more secure. When following Kenneth's method for executing root scripts via the nanoweb server mentioned on this page you would most likely need to be able to run a text-mode browser like lynx and pass the php script to it works great. On Debian this is the CLI version. On Ubuntu 6.

Hope this helps somebody else out there : Ruan Fourie. Interestingly, if you execute a script which is not in your path or you have made a typo, or if the script does no exist at all , you will get no return value.

Someone could add a note how this can be if it could be overriden, as the standard behaviour is not really fool-proof. I found something odd. View Add Comment Developer Edit. There is a thread of this issue at www. Kind regards Patrick. I tried putting cmd before a command, but invain. I can do the standard commands alright. It's like it is just reading the line, instead of executing it We're about to release 4. Many others also had a look at it.



0コメント

  • 1000 / 1000