Problem with PHP, SendMail and IIS?RSS

6 replies

Last post Jun 21, 2016 05:53 AM by Jean Sun

  • Problem with PHP, SendMail and IIS?

    Jun 15, 2016 03:41 PM|Web4Fun|LINK

    Hello, I will really appreciate everybody's input on this.

    I have a server running Windows Server 2012 R2 with IIS 8.5.96 and PHP 5.6.

    I have a PHP website running on this server, for which I setup SendMail to send e-mails like password resets, etc. Initially, my setup worked properly, I could send e-mails using a mailtest.php page and other PHP files; however, it just stopped working all of a sudden. One thing I noticed was that, when I tried to run the mailtest.php page, the web browsers just hang there waiting to load until they eventually give up (below), but every other PHP page works, including PHPInfo. This makes me believe the problem lies somewhere in PHP or FastCGI, but I can't seem to find a way to confirm that.

    HTTP Error 500.0 - Internal Server Error

    C:\Program Files (x86)\PHP\v5.6\php-cgi.exe - The FastCGI process exceeded configured request timeout

    Detailed Error Information:
    Module    FastCgiModule 
    Notification    ExecuteRequestHandler 
    Handler    PHP_via_FastCGI 
    Error Code    0x80070102 
    Requested URL    http://mysite.com:80/mailtest.php 
    Physical Path    C:\inetpub\sites\mysite.com\mailtest.php 
    Logon Method    Anonymous 
    Logon User    Anonymous 

    Any ideas?

    Are there any logs I can look at? The SendMail log shows nothing.

    When should I start looking?

    I included my SendMail.ini and PHP.ini config below. Again, this was working and then it wasn't; but I didn't make any changes.

    My SendMail.ini

    [sendmail]
    
    smtp_server=smtprelay.mailserver.com
    ; smtp port (normally 25)
    smtp_port=25

    My PHP.ini

    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = localhost
    ; http://php.net/smtp-port
    smtp_port = 25
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    sendmail_from = support@mysite.com
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    sendmail_path = "C:\usr\lib\sendmail.exe -t"

     Thanks in advance for any input on this.

  • Re: Problem with PHP, SendMail and IIS?

    Jun 16, 2016 02:42 AM|Jean Sun|LINK

    Hi,

     The FastCGI process exceeded configured request timeout

    Please increase the Request Timeout to a larger number.

    1. Double click FastCGI Settings
    2. open PHP.EXE listed there
    3. Monitor changes to file php.ini
    4. request timeout default is 90s - change to a larger number

    Best Regards,

    Jean

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: Problem with PHP, SendMail and IIS?

    Jun 16, 2016 03:56 AM|Web4Fun|LINK

    Thanks for your response. I just tried what you suggested and changed it to 180 seconds. However, it still doesn't load and eventually times out.
    Shouldn't I be looking into what is causing it to time out? The page I am trying to load used to load and send and email message in less than 2 seconds.
  • Re: Problem with PHP, SendMail and IIS?

    Jun 16, 2016 08:29 AM|Jean Sun|LINK

    Hi,

    Yes, you need to look into what is causing it to time out.

    Below are some links for your reference:

    How to: Enable ASP Debugging in IIS

    Troubleshooting Failed Requests Using Tracing in IIS 7

    Best Regards,

    Jean

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: Problem with PHP, SendMail and IIS?

    Jun 16, 2016 03:48 PM|Web4Fun|LINK

    Thanks for your response. Since the issue seems to be with a PHP script, I am going to use the second link you posted for this.

    Jean Sun

    Troubleshooting Failed Requests Using Tracing in IIS 7

    I will reply with my findings soon.

    Thanks again.

  • Re: Problem with PHP, SendMail and IIS?

    Jun 16, 2016 04:29 PM|Web4Fun|LINK

    OK, this is what I found using Failed Request Tracing. Sorry about the formatting.

    66. -FASTCGI_START 0 ms
    67. -FASTCGI_WAITING_FOR_RESPONSE Verbose 0 ms
    68. -FASTCGI_APPLICATION_MANAGER_SHUTDOWN ERROR 217875 ms
    69. -SET_RESPONSE_ERROR_DESCRIPTION WARNING 0 ms
    ErrorDescription C:\Program Files (x86)\PHP\v5.6\php-cgi.exe - The worker process must shutdown now or configuration has changed
     70. -MODULE_SET_RESPONSE_ERROR_STATUS WARNING 0 MS
    ModuleName FastCgiModule
    Notification EXECUTE_REQUEST_HANDLER
    HttpStatus 500
    HttpReason Internal Server Error
    HttpSubStatus 0
    ErrorCode The server machine is shutting down. (0x800704e7)
    ConfigExceptionInfo
     71. -NOTIFY_MODULE_END
    ModuleName FastCgiModule
    Notification EXECUTE_REQUEST_HANDLER
    fIsPostNotificationEvent false
    NotificationStatus NOTIFICATION_FINISH_REQUEST

    Any idea where to go from here?

  • Re: Problem with PHP, SendMail and IIS?

    Jun 21, 2016 05:53 AM|Jean Sun|LINK

    Hi,

    I didn't find any useful information based on the above error log.

    Please try configure other timeout settings , such as Activity Timeout.

    Best Regards,

    Jean

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.