Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
915 views
in Technique[技术] by (71.8m points)

PHP Script freezes after Mail()

PHP script freezes after the mail() command when run through a webpage, but runs fine on SSH.

Page just keeps loading forever, nothing executes after the mail() command, however, the mail() command does work and sends an email.

What could the problem be?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This should be a comment, but its a bit long.

You've not provided nearly enough information here.

It has been suggested that we need to see the code - if your description is accurate then we don't, however given the quality of information supplied the predicate is very dubious. What happens when you run something like:

 <?php
 print "started<br />
";
 while (ob_get_level()) ob_flush();
 flush();

 $result=mail('youruser@localhost', 'test', 'test');
 print "result=" . var_export($result, true);
 exit;

What do the access and error logs show for the script?

What does your MTA logs show?

What is your MTA?

What OS is this running on?

but runs fine on SSH

Does your CLI SAPI use the same php.ini files as the web server?

If not what are the respective configurations?

Are you running the CLI as the webserver uid?

(hint - that's 8 questions you need to answer before anyone can make an informed guess as to what's happenning here)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...