Reply to Re: shell_exec

Your name:

Reply:


Posted by Erwin Moller on 03/01/07 09:51

pradeep wrote:

> Hello,
>
> I want to copy file from remote machine to local machine using PHP.
> On both machines Linux operating system present.
>
> The code is
>
> $result=shell_exec("scp admin@192.168.1.236:/mnt/disc/hda/part1/demo/
> conn /opt/lampp/htdocs/upload/");
>
> This function return nothing & file is not copied.
> If I use above parameter on konsole , it copy successfully.
>
> Please, guide me.

Hi

Could it be a permissionproblem?
PHP runs as 'www-data' or 'apache', or' nobody'.
To debug you could try the following:
1) log in as the user PHP is. (Use touch somefile from PHP on some wideopen
directory to check if unsure)
2) give the command in Konsole

Does THAT work?

If yes, well, I would advise you to catch the output produced by the
command.
Use passthry() to catch the output. Maybe it contains some error that helps
you fix the problem.

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация