SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Gilroy, CA
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting PHP to send with efax

    I would like to get PHP to send out faxes using efax (the linux program, not the internet fax service). I'm getting very close, but I'm hitting a snag. I have efax up and running so that from the command line I can type "fax send number file" and it works.

    In my PHP code I try the following:
    $faxsend = "fax send " . $faxnumber . " /mnt/temp/testfile";
    exec($faxsend, $array, $result);

    It appears to execute the command, but it acts like the number is busy without ever actually dialing. I can see the process in the processlist, but it goes through a succession of sleep commands and reports back that the number is busy. The result array returned confirms that it thinks the number is busy.

    PHP is running as an apache module, apache is running as user apache, group apache. It was previously running as nobody, nobody. Permissions on all the fax files are read/write/x for everyone.

    I believe that the problem is one of permissions, because I cannot write and read files on my local drive even when read/write is set to everyone. I am able to write/open files on a NAS device located on my subnet which allows access to anyone. Yet I can't figure out what's wrong. I tried running apache as root but it wouldn't let me without recompiling and I'd rather not.

    thanks,
    Bernn

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Gilroy, CA
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    answer to efax & PHP

    For the Archives -
    It was a permission problem. The efax binary was unable to get permission to write it's log file and responded with a busy signal error. I managed to change the location of the logfile to the same NAS device with open permissions and got it to work. There didn't seem to be an option to specify the location of the log file so I had to hunt through the "fax" script file and hard-code it.

    I still don't understand why it is unable to write to my local harddrive when I set the permissions on the directory and log file to 555. I had the same problem writing to a file as I noted above. Any clues?

    Thanks,
    Bernn


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •