Internal Server Error 500 Php Mail
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us sendmail php Learn more about Stack Overflow the company Business Learn more about hiring developers or 500 internal server error php posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Php Mail Function
Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP's mail() function causes a 500 Internal Server Error only after a certain point in the code up vote 2 down vote favorite Several days ago, all mail() calls in my custom PHP application cause a 500 Internal Server Error and the only error logged is Premature end of script headers. Running the file via SSH sometimes returns a segfault. The strange thing is no code changed between the time when the mail() call worked, and stopped working (changes are tracked in Git). Even though no changes were made to the code, I still went through and did the normal checks (.htaccess, php.ini, custom error handler, etc), just to be safe. I attempted to diagnose the problem by cutting out code in the application until the issue was pinpointed. However, this did not narrow it down to a specific piece of code, but rather the amount of code loaded into PHP (but not yet run) as the time of the mail() call. In the trimmed application, I was able to get one mail() call to work, but the second would fail. The first call was immediately before an include call (require has same outcome). The second was at the very beginning of the included file (preceded only be the opening PHP tags). My original thoughts were it was some sort of memory issue. Oddly, the memory usage required to cause the mail() call to throw an error changes based on which code is kept/removed from the overall application. In case it can still help, the memory usage for the current collection of code before including the file is: Usage: 3113696 Max: 3352560 The memory usage after inclu
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/9725575/phps-mail-function-causes-a-500-internal-server-error-only-after-a-certain-po them; it only takes a minute: Sign up PHP 500 Internal Server Error- mail function up vote 0 down vote favorite I'm getting the 500 Internal Server Error. I called goDaddy and they told me it's not something on their end. I also don't have a .htaccess file. I checked the contact page and checked spelling it is calling http://stackoverflow.com/questions/31434919/php-500-internal-server-error-mail-function the right .php file. This code was working perfectly. I tried to change something it didn't work. I tried going back to the original code and now that doesn't work either. I don't have a backup. I commented out line by line to pin-point the problem if I erase the mail($to, $subject, $message, $headers); part I don't get an error but obviously don't receive anything. Here is the website if that helps to inspect. http://www.crownjewelre.com/contacts.html
Name: | ".$first_name." | ".$last_name." |
---|---|---|
Email: | ".$email." | |
Telephone: | ".$telephone." |
Comments: ".$comments."