开发者

command is not running from php script using shell_exec() or system() or exec() functions

开发者 https://www.devze.com 2023-01-07 16:32 出处:网络
I am working on Windows server and able to run command fr开发者_如何转开发om command prompt c:> %convertxls% {some args....}

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消