[Pugged] php system() command

Dave J. Hala Jr. ciapug@ciapug.org
27 Aug 2002 12:49:36 -0500


Can you symlink /root/tmp to /tmp?

On Tue, 2002-08-27 at 12:38

, dave@visionary.com wrote:
> I'm trying to run an external command for a pdf generator - it's the Fytek "pdffile". We have an app that uses the win32 version. They recently released a Linux version and we're trying to port it over.
> 
> The Fytek people don't know much about linux... their app is written in Perl, and they used PerlApp to "compile" it into a binary.
> 
> I can run the "pdffile" binary from the command line and it generates PDF's just fine.
> 
> I'm attempting to do it from PHP using this:
> 
> <?
> system("pdffile source.rpt output.pdf");
> ?>
> 
> I think the problem is that the binary is trying to use /root/tmp for it's temporary files. Apache is running as nobody, and nobody can't write to /root/tmp. (That doesn't sound grammatically correct...)
> 
> The Fytek guys thought I should try wrapping the call to the binary in a shell script where I set the $TMP system var to /tmp. I've tried that and it doesn't work for me.
> 
> I've tried variations of this script with putting the full path in and such... but here's the general idea:
> 
> #!/bin/bash
> export TMP=/tmp
> ./pdffile $1 $2
> 
> Again, I can run this from the cmd line and it works.
> 
> Any ideas on this?
> 
> -dc
> 
> _______________________________________________
> Ciapug mailing list
> Ciapug@ciapug.org
> http://cialug.org/mailman/listinfo/ciapug