Re: Different behaviour : command line / cron

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mbneto escribió:
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@xxxxxxx", "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?

Try deactivate php_gtk extension in PHP-CLI if you have it loaded... I had the same problem you describe and while googling I found about this solution and worked fine.

--
Miguel J. Jiménez
Programador Senior
Área de Internet/XSL/PHP
migueljose.jimenez@xxxxxxxxxxx

----------------------------------------------------

ISOTROL
Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.
Parque Tecnológico Cartuja '93, 41092 Sevilla.
Teléfono: 955 036 800 - Fax: 955 036 849
http://www.isotrol.com

"You let a political fight  come between you and your best friend you have in all the world. Do you realize how foolish that is? How ominous? How can this country survive if friends can't rise above the quarrel".
Constance Hazard, North & South (book I)


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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux