0

Following is my code

<?php  $output = shell_exec('ls -lart');   print $output;  ?>

Its working in linux system but its not work in windows system,

1
  • Linux and Windows are two different operating systems which understand different commands. Commented Feb 10, 2015 at 9:30

1 Answer 1

2

LS is a GNU/Linux utility. Try to use a windows equivalent like dir. For example:

<?php  $output = shell_exec('DIR /S');   print $output;  ?>
Sign up to request clarification or add additional context in comments.

4 Comments

No it's not. That's the answer.
@Sergiu Paraschiv It does not answer the question, the OP is asking why doesn't it works
Right, _Because _ "LS is a GNU/Linux utility.". He then also offers an alternative solution. This is the best answer there could be.
Well. The user didn't ask a question but let's solve the issue doing it more evident.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.