0

I want to run CMD commands in php through shell_exec() function to get the domain details. When I try $detail = "whois " . "google.com"; echo $res = shell_exec($detail);

on online php editor it return correct information but when I run this code on local server Xampp it shows blank screen does not show any result or any error.

  • you are not echoing the result of the shell_exec()? – noid Sep 24 '18 at 12:33
  • Do not shell out to run the whois command from PHP, as there is no need to and a lot of drawbacks. You have multiple libraries in any language, including PHP, to do whois queries. At the very least, whois is a simple query/response protocol over TCP/43 so that can be done from inside PHP very easily. – Patrick Mevzek Jan 04 '19 at 21:23

0 Answers0