Execute shell command, no return value

Hello.

I have a command that I write (in promt/shell) to get a list of “correct options” of a mispelled word. When I press enter it returns a bunch of words. Everything works good.

Problem is when I do the same thing through PHP shell_exec(‘my command’) it returns nothing. I tried with shell_exec(‘dir’), just to see if it works with anything else and it does, I get the output.

Im using Windows.

What can be wrong?


Best regards
Neo

Try using PHP exec(); function because it returns the second two parameters by reference supplying more information and may be more useful.

https://www.php.net/manual/en/function.exec.php

Can you also supply example test cases that users may try.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.