我有一個模板,我下載了它,並帶有一個PHP表單。資源:服務器迴應500(內部服務器錯誤)的狀態IIS PHP聯繫表單 - 無法加載資源:服務器響應狀態爲500(內部服務器錯誤
HTML:
<form action="contact-form.php" method="POST" class="contact-form">
<ul class="row">
<li class="col-md-6 form-item">
<label for="contact-name"><i class="ico-male"></i></label>
<input type="text" name="contact-name" class="contact-name" id="contact-name" value="Your Name" onblur="if(this.value=='')this.value='Your Name'" onfocus="if(this.value=='Your Name')this.value=''">
</li>
<li class="col-md-6 form-item">
<label for="contact-email"><i class="ico-email"></i></label>
<input type="email" name="contact-email" class="contact-email" id="contact-email" value="Your Email" onblur="if(this.value=='')this.value='Your Email'" onfocus="if(this.value=='Your Email')this.value=''">
</li>
<li class="col-md-12 form-item">
<label for="contact-message"><i class="ico-bubble"></i></label>
<textarea name="contact-message" class="contact-message" id="contact-message" data-placeholder="Your message"></textarea>
</li>
<li class="col-md-12 form-item">
<input type="submit" name="contact-btn" class="contact-btn general-link" id="contact-btn" value="Send Your Message">
</li>
</ul>
</form><!-- end of contact form -->
PHP:
<?php
if($_POST["submit"]) {
$fromEmail = strip_tags($_POST['contact-email']);
$fromName = strip_tags($_POST['contact-name']);
$themessage = strip_tags($_POST['contact-message']);
$themessage = $themessage."The Sender Is (".$fromName.")" ;
$toEmail = '[email protected]';
$toName = 'JH';
Mail::send('emails.contactus', $data , function($message) use ($toEmail, $toName, $fromEmail, $fromName, $subject)
{
$message->to($toEmail, $toName);
$message->from($fromEmail, $fromName);
$message->subject($subject);
});
$headers = 'From:' .$fromName . "\r\n" .
'Reply-To:' .$fromEmail. "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($toEmail, $subject, $themessage, $headers))
{
// Send
echo "success";
}
else{ echo "An error has be occured"; }
}
?>
我這樣做本地IIS服務器和REC上消除這一點。
編輯:
它顯示錯誤HTTP錯誤500.0 - 內部服務器錯誤 C:\ Program Files文件\ PHP \ V7.0 \名爲php-cgi.exe - FastCGI進程意外退出
The FastCGI process exited unexpectedly
你可能會使用C:/ [你的PHP目錄] /php.ex我已經通過顯示在其他的答案,如修復了e在IIS的Handler映射中,只需將其更改爲C:/ [your-php-directory] /php-cgi.exe。
IIS 7.5 PHP failure "The FastCGI process exited unexpectedly"
要解決它,我不得不安裝Visual C++可再發行的Visual Studio 2012更新3
它仍然顯示了同樣的錯誤。不知道現在如何解決這個問題。
打開錯誤報告並找出是什麼導致它 – Epodax
@Epodax感謝上面的 – Sam