I am working on Windows server and able to run command fr开发者_如何转开发om command prompt
c:> %convertxls% {some args....}
But when I run same command from php script
*shell_exec(%convertxls% ..... 2>&1);*
it gives me error as
%convertxls% is not recognized as an internal or external command, operable program or batch file.
I think when I am running command from command prompt, it run for user which logged in. And when I run the php script it run for "www" user for which path is not set.
Can anybody tell me where I am doing mistake?
*Note: I haven't written complete command.
Supply the full path to the executable.
ignacio right,I wanted to add one more point that ignacio did not specify .
Check the parameter disable_functions in the php.ini .
maybe this function is not allowed.
This sounds like the environment variable %convertxls%
is not set.
You can use putenv()
to set it; alternatively, as Ignacio already says, specify the full path.
精彩评论