locked
Problem with PHP, SendMail and IIS? RRS feed

  • Question

  • User698628228 posted

    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.

    Wednesday, June 15, 2016 3:41 PM

All replies

  • User1278090636 posted

    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

    Thursday, June 16, 2016 2:42 AM
  • User698628228 posted
    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.
    Thursday, June 16, 2016 3:56 AM
  • User1278090636 posted

    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

    Thursday, June 16, 2016 8:29 AM
  • User698628228 posted

    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.

    Troubleshooting Failed Requests Using Tracing in IIS 7

    I will reply with my findings soon.

    Thanks again.

    Thursday, June 16, 2016 3:48 PM
  • User698628228 posted

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

    <fieldset class="no-border" id="section_detail_65"></fieldset><fieldset><fieldset class="no-border" id="section_detail_66">66. -FASTCGI_START 0 ms</fieldset><fieldset class="no-border" id="section_detail_67">67. -FASTCGI_WAITING_FOR_RESPONSE Verbose 0 ms</fieldset><fieldset class="no-border" id="section_detail_68">68. -FASTCGI_APPLICATION_MANAGER_SHUTDOWN ERROR 217875 ms</fieldset><fieldset class="no-border">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
    </fieldset><fieldset class="no-border" id="section_detail_70"> 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
    </fieldset><fieldset class="no-border" id="section_detail_71"> 71. -NOTIFY_MODULE_END
    ModuleName FastCgiModule
    Notification EXECUTE_REQUEST_HANDLER
    fIsPostNotificationEvent false
    NotificationStatus NOTIFICATION_FINISH_REQUEST
    </fieldset></fieldset>

    Any idea where to go from here?

    Thursday, June 16, 2016 4:29 PM
  • User1278090636 posted

    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

    Tuesday, June 21, 2016 5:53 AM