|
|

03-01-2007, 09:20 AM
|
|
Member
|
|
Join Date: Mar 2006
Location: New York
Posts: 42
|
|
PHP mail function issue
I cannot seem to send an email message using Litespeed, but I can use the same file from the command line with success.
I am not really sure what's going on here, i feel like it may be permissions, but i tried sending as the user that Litespeed is run under and it works.
I'm hoping to get some ideas to try in here 
|

03-01-2007, 09:37 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
What kind of method are you using to send email, sendmail? mail? or SMTP?
It is a PHP problem, you can use "strace" to trace the PHP process to find out what exactly causes it.
|

03-01-2007, 10:15 AM
|
|
Member
|
|
Join Date: Mar 2006
Location: New York
Posts: 42
|
|
|
Well this is the thing, i created a file using the mail function that just sends out an email to me, nothing fancy at all. If i run it from the command prompt as the user Litespeed is run as, it works just fine. I can see the email enter my qmail queue and then it goes out.
When i use the same file as a web request, the email enters my mail queue but never gets sent out.
The only difference is that i am triggering it using LSAPI rather than on the command prompt.
My PHP is compiled by me and both the CLI and LSAPI have the same exact configure setting with the exception of "--with-litespeed".
That's why i think it may be something with my configuration.
|

03-01-2007, 11:10 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
You can use the LSAPI version as the CLI one.
If the email got into the mail queue, it may not be a PHP email problem, maybe missing something in the email message itself.
|

03-01-2007, 11:31 AM
|
|
Member
|
|
Join Date: Mar 2006
Location: New York
Posts: 42
|
|
|
Nothing is missing from the email if the same file works from the command line but doesn't when accessed through a browser:
mail( 'someemail@gmail.com',
'Just testing mail from php',
'blah',
"From: \"Testing\"<test@testdomain.com>\n".
"Content-Type: text/plain; charset=\"utf-8\"\n".
"Return-path: <test@testdomain.com>"
);
I don't think it could be any simpler really, are there any settings in Litespeed that would prevent this from going through?
|

03-01-2007, 12:00 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
I think there might be something in php.ini prevent the mail function work properly. You can try CLI or LSAPI PHP from comand line using option "-c <path_to_php.ini>", see if you get the same result as run under LSWS.
For LSWS configuration, please double check process soft/hard limit and memory limit, make sure they are large enough.
|

03-01-2007, 12:30 PM
|
|
Member
|
|
Join Date: Mar 2006
Location: New York
Posts: 42
|
|
|
using the -c option from the command line still results in the email being sent.
My current options for the memory and process limits are:
Memory Soft Limit (bytes) number 100M
Memory Hard Limit (bytes) number 200M
Process Soft Limit number 200
Process Hard Limit number 200
Should they be higher?
|

03-01-2007, 01:15 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
those numbers are looking fine.
Maybe you need to set "sendmail_path" in php.ini
details are in http://us3.php.net/mail
LSWS will not pass your shell PATH environment to PHP started by it, instead, it set PATH to "/usr/bin:/bin", so a wrong "sendmail" might be used. you can set PATH in environment explicitly as well.
|

03-01-2007, 04:44 PM
|
|
Member
|
|
Join Date: Mar 2006
Location: New York
Posts: 42
|
|
|
My php.ini settings are correct:
Path to sendmail: /var/qmail/bin/sendmail
So it's a full path. I don't have a sendmail under /usr or /usr/lib
|

03-01-2007, 05:02 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
Then try set PATH environment variable to the same value as your shell, if there is other environment variables required by qmail, add them to lsphp's environment.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:04 PM.
|
|