use PHP to call out windows function (dir, ls, wget ,etc )

HI,
I'm on the verge of writing a php script that will download files from several websites to my server using PHP.
Since this is my own server therefore I enabled shell exec for PHP installation, (windows server 2003 platorm, I installed several GNU tools for windows as well) . I attached the code below.

when I executed that script via the browser, I received

TESTING EXEC FUNCTION
Array

and I don't see any downloaded file in the folder (I assume the file will be downloaded to the same folder with the script)

Can you please give me any insight?
THanks so much



<?php
echo "TESTING EXEC FUNCTION<br>";
exec ('wget http://domain.com/shapefile_shp_zip', $command_output);
echo  $command_output;
?>

Open in new window

valleytechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LordWolfyCommented:
instead of echo $command_output try this:

foreach ($command_output as $command_output_element)
{
  echo "$command_output_element\n";
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
valleytechAuthor Commented:
Thanks millions.
I had tried that before posting this question with "ls -la". It worked just fine.
but for "wget" (utility to download file from URL), it just showed nothing.

Thanks again!
0
LordWolfyCommented:

If that solves your problem can you please close the question by accepting the answer
0
valleytechAuthor Commented:
right! sorry ^^ ..iwas busy with other stuffs
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.