Re: Problem in executing linux command from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gnanavel wrote:
I have problem in executing  linux command
$output=exec("ls -a");
echo "<pre>$output</pre>";

the above coding works, but

$output=exec("cp file1 file2");
echo "<pre>$output</pre>";

does not works. can any one help me out of this problem

When I was executing the "cp" command it doesn't return anything. But it returned the name of the last file when i executed the "ls" command


try it on the command line ..


`cp file1 file2` doesn't return anything - so your script probably is working as it correctly returns nothing.

if you want to see output try

`cp -v file1 file2`

--

Sean

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux