exponentcms / exponent-cms

Content Management, Simple.
exponentcms.org
GNU General Public License v2.0
59 stars 24 forks source link

error after migration #1565

Open eVenster opened 11 months ago

eVenster commented 11 months ago

After a migration there is an error, which reads: mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function expProcessBuffer() in /XXX/public_html/index.php:32 Apache error mod_fcgid: stderr: Stack trace: Apache error mod_fcgid: stderr: #0 [internal function]: epb() Apache error mod_fcgid: stderr: #1 {main} Apache error mod_fcgid: stderr: thrown in /XXX/public_html/index.php on line 32

All pages return a 400 It concerns Exponent 2.7.1 p2

dleffler commented 10 months ago

I've seen this error only once before. Not sure if it wasn't an Apache or mod_fcgid error. You MIGHT be able to circumvent it by moving some lines of code in /index.php. The current code lines 28-33 has several commented lines

function epb($buffer, $mode) {
//    @ob_gzhandler($buffer, $mode);
//    @ob_gzhandler($buffer);
//    return $buffer; // uncomment if you're messing with output buffering so errors show. ~pb
    return expProcessBuffer($buffer);  // add/process css & jscript for page
}

Remove the 2 slashes at the beginning of line #31 and add them to the beginning of line #32.

function epb($buffer, $mode) {
//    @ob_gzhandler($buffer, $mode);
//    @ob_gzhandler($buffer);
    return $buffer; // uncomment if you're messing with output buffering so errors show. ~pb
//    return expProcessBuffer($buffer);  // add/process css & jscript for page
}

This will prevent most css info from begin on the page, but will load the page, HOWEVER it should expose the error/warning which causes line #28 (output) to be called too early (e.g., an error before the first few lines of line #38 'require_once('exponent.php' is called to declare function expProcessBuffer()

Once you nail that down, you can reverse the comments as per the original code.

eVenster commented 10 months ago

I Tried uncommenting/commenting lines 32 and 31. The homepage loads, without CSS, any other pages doen not load. I'm not a programmer, so

"This will prevent most css info from begin on the page, but will load the page, HOWEVER it should expose the error/warning which causes line https://github.com/exponentcms/exponent-cms/issues/28 (output) to be called too early (e.g., an error before the first few lines of line https://github.com/exponentcms/exponent-cms/pull/38 'require_once('exponent.php' is called to declare function expProcessBuffer()

Once you nail that down, you can reverse the comments as per the original code."

is not something i'm able to do

dleffler commented 10 months ago

Do you have access to the server error log? You might also try editing the /framework/conf/config.php file and changing the following line setting from 0 to 1 to turn on Error Reporting manually:

define("DEVELOPMENT",'0');

The reload the web page which should hopefully reveal the error, HOWEVER the best error reporting would be at the end of the server error log file.