Forum Moderators: coopster
efax -o1 -d/dev/modem -t5035884445 /var/www/inventory/html/BackOfcOps/faxfiles/testfile
As stated previously, this worked perfectly. Next I transferred this command to the passthru, and the other related functions in PHP. Also created two other passthru lines using the "whoami" and "pwd" commands. When I executed the command, I got an error. The error in the error_log stated that permission to access device file was denied. The "whoami" and "pwd" commands worked perfectly. I checked the file permissions and that are good. I checked the ownership and even changed the ownership and those settings are good. I checked the php.ini file and i'm not in safe mode. What am I missing? Any help would be greatly appreciated. I did try to install hylafax and it had install problems that hylafax has yet to respond to with a solution.
Thanks in advance for your help....Bob
There are two things i would recommend trying. The first is, that you can get rid of the -d argument because what you have it set to is the default. The second, and more important, is this:
When using Class 1 modems the program must respond to certain events within 55 milliseconds. Longer delays may cause the fax protocol to fail in certain places (between DCS and TCF or between RTC and MPS). Class 1 modems should therefore not be used on systems that cannot guarantee that the program will respond to incoming data in less than 55 milliseconds.
So in the end, you are left with this:
passthru("efax -t5035884445 /var/www/inventory/html/BackOfcOps/faxfiles/testfile");
If this doesn't work, which im not sure if it will, obviously reply with another post
I tried your suggestion and still got the same message.
efax: Fri May 19 14:07:54 2006 efax v 0.9 Copyright 1999 Ed Casas
efax: 07:54 Error: can't open serial port /dev/modem: Permission denied
efax: 07:54 failed -> /var/www/inventory/html/BackOfcOps/faxfiles/testfile
efax: 07:54 done, returning 2 (unrecoverable error)
that was the error message in the /var/log/httpd/error_log file. The following is the revised passthru command that generated the message above:
$faxcommandstring ="efax -t5035884445 /var/www/inventory/html/BackOfcOps/faxfiles/testfile";
$status = 0;
passthru($faxcommandstring,$status);
I strongly believe its a system protection thing somewhere cause I can get this to work from the command line as user apache and other usernames. I've looked at all sorts of things at the system level and am just not seeing it. I have a whoami command that works just fine and a pwd command that works just fine both from within PHP. Don't know if you agree or not, but I think it has something to do with trying to access a device file from PHP. I'm at a loss. I'm thinking of writing a program that runs in the background and looks for files and then executes the fax command from within that program which can run as a different user than apache. Dont know if that makes sense. Any thoughts?
Bob
[redhat.com...]