You are here: Re: PHP and command line (for Wiki) « PHP Programming Language « IT news, forums, messages
Re: PHP and command line (for Wiki)

Posted by gosha bine on 07/03/07 07:57

On 03.07.2007 01:32 Ale wrote:
> Hi - I simplified the code at the maximum and wrote:
>
> <?php
>
> $fp = fopen(".\f.tex","a+");
> fputs($fp,'s_1');
> fclose($fp);
> echo exec('2>&1; latex .\a.tex');
>
> ?>
>
> f.tex is written in the same folder where the PHP page is executed,
> showing that I have the proper permissions on the folder. When I
> execute
>
> latex .\a.tex
>
> from shell, where a.tex is a properly formatted latex source, all work
> fine.
> However, "echo exec('2>&1; latex .\a.tex'); " does not provide the
> attended results, not giving any output file. It returns the message
> "operable program or batch file".
>
> I really have no idea what is wrong :(
>
> Cheers,
> Ale
>

2>& goes after command, not before it:

exec('latex .\a.tex 2>&1', $output);
print_r($output);


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

 

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

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