Results 1 to 1 of 1

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    98
    Plugin Contributions
    1

    Default Getting 503 Service is Not Available with custom script when Down For Maintenance

    Quote Originally Posted by pjbonarrigo View Post
    Yes, 503, that's as far as I have gotten so far.
    I have looked through the associated PHP code.
    Any suggestions?
    I just wanted to comment because I've experienced a 503 when Down For Maintenance is enabled. I'm not running IIS at all. [edit: i'm running httpd 2.x on unix]

    I have a php script in the root of my filesystem that I hit for ajax style requests.. so, the main web page loads (e.g. http://ourserver.com/admin/whatever.php) and the code on that page requests /ajaxHandler.php?foo=bar. So that it can integrate with Zen Cart's utilities ($db, defines, etc) I "include('includes/application_top.php') at the head of this file. When the site is 'down for maintenance', I find that the ajaxHandler.php request returns 503. This means the ajax-driven funcitonality on the page breaks.

    I don't know why the 503 is returned, but here's my investigation:

    If I put just /ajaxHandler.php?foo=bar into my browser, to directly request the resource, I get the 503 as expected. Now, strangely, if I put an "echo 'hello'" into includes/application_top.php, or includes/autoload_func.php, the 503 stops happening and everything executes correctly (except for the stray 'hello' in the output stream). I presume this is because it breaks an attempted zen_redirect, which would fail if the output stream has been committed. Thus, I guess the $down_for_maint_flag check in init_customer_auth.php which tries to call zen_redirect is what's being reached, but I don't see why this would cause a 503 response code.

    That's as far as I've got and I'm a bit tired of debugging this, I'm happy to turn off Down For Maintenance when using this ajax functionality. I thought these thoughts might help someone.

    If there is a way of keeping DFM on, and using my ajax script, I'd be very glad to hear it :) If this deserves its own thread I'll be happy to re-post for discussion.

    Nick
    Last edited by neekfenwick; 18 Nov 2010 at 08:57 AM. Reason: comment on using httpd

 

 

Similar Threads

  1. v155 Login required by admin to browse when Down-for-maintenance
    By mc12345678 in forum General Questions
    Replies: 4
    Last Post: 2 Apr 2016, 02:41 AM
  2. v150 Redirect when the website is down for maintenance
    By jhowe in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Aug 2012, 06:30 AM
  3. v150 Issue when down for maintenance
    By mkyle in forum General Questions
    Replies: 6
    Last Post: 23 Jul 2012, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg