system() has the same problem as passthru. Thanks for the suggestion
I wonder if I should post this to the bug list?
"Nicole" <430ntr3kaeontrek.com> wrote in message
> Did you try using the system() command instead and skip using exec and
> "Exasperated" <phpinstruform.com> wrote in message
> news:20030914202252.32486.qmailpb1.pair.com...> > Anyone come across something like this before?
> > I have made a little test script as follows:
> > <?
> > header ("Content-Type: application/pdf");
> > $command_line = "/usr/bin/pdflabelseries " .
> > escapeshellcmd($_POST['labelstart']) . " " .
> > escapeshellcmd($_POST['labelend']);
> > exec ("echo \"$command_line\" >/opt/specs/labels.txt");
> > //passthru($command_line);
> > ?>
> > The form takes input from a posted form with two variables, labelstartposted> > labelend. In the above test, if I put in 'start' and 'end' as thehttp> > variable data, the output from /opt/specs/labels.txt (writable by thethe> /opt/specs/labels.txt> > server) is:
> > /usr/bin/pdflabelseries start end
> > All is well and good. Now is where it heads South. I uncomment the
> > passthru command above. The output from the script in> > from the same posted form with the same data entered is now:
> > /usr/bin/pdflabelseries
> > pdflabelseries is a C program that I have confirmed works perfectly onthat> output> > command line (i.e. generates the requisite pdf file to stdout).
> > Even if the C program fails (which it does not appear to do from the> > in the httpd logs as it outputs its command line to stderr), surely php
> > should not lose its own internal variables, especially, for a command> > is executed BEFORE the passthru command.
> > I am truly baffled.
> > Any help appreciated.
> > Regards
> > Mark
> > I am running vanilla Mandrake 9.1 with the following PHP rpms:
> > libphp_common430-430-11mdk
> > php-pear-4.3.0-3mdk
> > apache2-mod_php-2.0.44_4.3.1-2mdk
> > php-xml-4.3.0-2mdk
> > php-dba_bundle-4.3.0-4mdk
> > php-pgsql-4.3.0-4mdk
> > php-xmlrpc-4.3.0-2mdk
> > php-manual-en-4.3.0-2mdk
> > php430-devel-430-11mdk
> > php-gd-4.3.0-2mdk