ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem saving a template with php tags inside

January 30, 2011 11:17pm

Subscribe [2]
  • #1 / Jan 30, 2011 11:17pm

    Eric Snyder

    202 posts

    When I save a template that contains php tags it gives me the dreaded:

    500 Internal Server Error
    The request was not completed. The server met an unexpected condition.

    the worst! That error is usually hard to get good info from.

    If I save the template as a file using an editor and an FTP client the page loads fine and the php logic runs fine.

    Digging in a bit…if either of these lines is in the template when I save the template it throws that 500 error:

    $result = $this->EE->db->query("SELECT * FROM exp_sites WHERE site_id = 1");

    or

    $result = $this->EE->db->query('SELECT  s.*,
            t.*
            FROM exp_structure AS s
            LEFT JOIN exp_channel_titles AS t ON s.entry_id = t.entry_id
            LEFT JOIN exp_category_posts AS c ON s.entry_id = c.entry_id
            WHERE s.dead NOT LIKE "root" 
                AND c.cat_id = 5
                AND t.status = "open"
            ORDER BY s.lft asc');

    Any ideas?

  • #2 / Jan 31, 2011 3:59pm

    Ingmar

    29245 posts

    Sounds like a possible intervention by mod_security. Can you check with your host? What version and build of EE are you running?

  • #3 / Jan 31, 2011 4:14pm

    Eric Snyder

    202 posts

    What would I be looking for?

  • #4 / Feb 01, 2011 2:38am

    Greg Aker

    6022 posts

    Eric,

    Ask your server admins/hosting company if they are running mod_security.  Second, ask them to see if they can provide you with error log information with 500 errors.

    -greg

  • #5 / Feb 01, 2011 11:04pm

    Eric Snyder

    202 posts

    Yes, mod_security2 has been enabled.

    The error log was logging errors. Is this possibly a permission issue? My host made some permission changes that day.

    [Sun Jan 30 21:17:11 2011] [error] [client xx.xxx.xxx.xxx] File does not exist: /home/defaulte/public_html/eeadmin/sys_cpanel, referer: http://removed domain name.com/eeadmin/index.php?S=fe5dcf55bb63d064d50c323a329b6fcc00522d28&D=cp&C=design&M=update_template&tgpref=2

  • #6 / Feb 02, 2011 4:02pm

    Ingmar

    29245 posts

    Can you try to have them disable / tweak mod_security?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases