system() has the same problem as passthru.  Thanks for the suggestion
anyway.

I wonder if I should post this to the bug list?

"Nicole" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Did you try using the system() command instead and skip using exec and
> passthru?
>
> --
> Nicole
>
>
> "Exasperated" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > 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, labelstart
and
> > labelend.  In the above test, if I put in 'start' and 'end' as the
posted
> > variable data, the output from /opt/specs/labels.txt (writable by the
http
> > 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
> /opt/specs/labels.txt
> > 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 on
the
> > 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
> output
> > 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
that
> > 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to