Re: Problem in executing linux command from PHP
| From: | Gnanavel | Date: | Sat, 06 Sep 2003 22:55:04 +0000 |
| Subject: | Re: Problem in executing linux command from PHP | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30396@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: Sean Burlington <sean@uncertainty.org.uk>
Newsgroups: php.db
To: <php-db@lists.php.net>
Sent: Tuesday, September 02, 2003 1:11 PM
Subject: Re: [PHP-DB] Problem in executing linux command from PHP
> 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
>
> --
>
Thanks for help
The problem is the file is not copied to destination folder. I experience
the problem for all file modification commands like "mv" etc..
I am unable run a shell script file from php which contains file
modification commands.
> Sean