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.

Tricky PHP error with "eval" => Apache/FastCGI or other configuration issue?

May 06, 2013 6:12pm

Subscribe [0]
  • #1 / May 06, 2013 6:12pm

    greenpages

    1 posts

    I am using a shared host @ A2 Hosting and they use an Apache/FastCGI server model for PHP.

    A recent rev of their PHP (to 5.3.22) caused seemingly random pages of my site to throw the error:

    A PHP Error was encountered
    Severity: Warning
    Message: Please contact support about failure
    Filename: libraries/Functions.php
    Line Number: 679

    This is the line wherein it states: return eval(’?’.’>’.$str.’<?php ‘);

    Anywho, after 5 hours debugging, guess what the errant pages had in common?:

    If they contained the characters “eval” anywhere in the template or in the called tags (e.g., in the {title} that was called) and PHP parsing was turned on, the error was thrown.

    All the pages simply had content that included the work “evaluate”. Changing the word to “analyze” or “evacuate” fixes the issue. Random, or what?

    I tested with a stock 2.6 install on this server and can reproduce the issue. If I install on my local box using Apache/Mod-PHP, then I can’t reproduce the problem.

    Anybody have experience with this? It might not have anything to do with CGI vs. ModPHP ... perhaps another configuration option? Or maybe some CGI / eval lockdown code?

  • #2 / May 06, 2013 9:52pm

    greenpages

    1 posts

    Figured this out with help from A2’s knowledgebase. Probably particular to their environment, but in case anybody encounters something similar, I needed to add the following line in .htaccess:

    SetEnv PHPRC /usr/local/lib/php-unsafe.ini

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

ExpressionEngine News!

#eecms, #events, #releases