I am trying to configure sendmail to forward email to a PHP script. I don't know UNIX and am having trouble figuring out how to forward the mail. I think this is just a bunch of basic questions, but I have had little luck getting help elsewhere on my specific questions and it's driving me nuts. You can see the instructions I am trying to follow here:
http://www.devarticles.com/c/a/PHP/I...ail-and-PHP/1/
The instructions say I need to do 3 things:
1) forward email using either a ".forward" file or a modified "alias" file (the preferable method, if I have "root access")
I want to use the alias file, seeing as it's the preferred method. Supposedly the alias file should be found in my /etc directory, but using shell access to my site I see no such file in the /etc folder off the top directory. Am I looking in the wrong place? Do I have to create it? If I want to create/modify the alias file to forward mail sent to
script@myurl.com to "|/our/script.php", what specific command do I use?
With regard to the .forward file, I've been wandering around among the directories trying to find my mail folder so I can put the .forward file in there, but I have no idea where it should go.
2) Now the instructions say "Since our script will function as a shell script, the first line should contain the path to the PHP CGI program. This is most likely located at /usr/bin/php of /usr/local/bin/php. This tells the operating system that this script must be parsed by PHP."
I'm sorry for asking such a stupid question, but what does the "of" in "/usr/bin/php of /usr/local/bin/php" mean? I see a file "php@" in the directory "/usr/local/bin/php" but I do not know what is meant by "/usr/bin/php of /usr/local/bin/php". Also, how do I tell that PHP is compiled as a CGI module?
3) Once I write and save the script, I must put it in the correct location, and make it executable with "chmod 755"
Googling chmod, my understanding is that to do this, I navigate to the directory my script is in, and type "chmod 755 script.php" Is that right?
Thanks for your help.