Different behaviour : command line / cron
| From: | mbneto | Date: | Tue, 17 Apr 2007 22:41:46 +0000 |
| Subject: | Different behaviour : command line / cron | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-253153@lists.php.net to get a copy of this message | ||
Hi,
I've developed a simple script that among other things sends a fax using
hylafax's sendfax program. If I test it calling directly from the command
line it works fine.
If I let it run from cron it executes everything fine except the fax.
I am using the system call and in order to debug I am using the following
code
...
$cmd = sprintf('/usr/bin/sendfax -n -d %s %s',$fax,$file) ;
mail ("myemail@foo.com", "fax", $cmd."\n".system($cmd));
...
The output from the command line (/usr/bin/php /path/to/file/script.php)
/usr/bin/sendfax -n -d fax_number /tmp/fax.txt
request id is 471 (group id 471) for host localhost (1 file)
The output when it executed from cron (*/1 * * * * /usr/bin/php
/path/to/file/script.php)
/usr/bin/sendfax -n -d fax_number /tmp/fax.txt
In both cases the fax.txt has the same content.
Any idea why and how to solve it?