You are here: Re: Exec and Redirecting Output « PHP Programming Language « IT news, forums, messages
Re: Exec and Redirecting Output

Posted by Jerry Stuckle on 09/14/06 04:07

btysgtmajor@gmail.com wrote:
> Hi all,
>
> I've searched high and low on this group and elsewhere and can't
> really seem to find an answer to this question. I'm running PHP4 on a
> Debian box with Apache. I'm trying to run the "exec" command
> withsomething fairly simple like "cat", e.g. exec("cat < a.txt >
> b.txt");. I'm noticing that no matter what kind of
> redirecting/piping/whatever you want to call it I do, the redirections
> don't work (at least the redirecting of the output). I can run the
> same command from the command line and it works (of course).
>
> Is this some kind of permissions deal? I've tried making the call to
> be in places where a.txt and b.txt are in a directory that have R/W/X
> permissions for PHP (I chose a directory that I actually can
> successfully use the fopen et al commands with, including writing).
>
> Does anyone have any ideas?
>
> Thanks in advance!
>

Redirection is done by the shell, not the OS. If you want to use
redirection you either need to invoke your program through the shell or
handle the redirection yourself (much easier in C/C++ than PHP, although
still not easy).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this 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

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