On several of my EE2.6.1 websites I am noticing that the log files are getting bloated with the following notice over and over again:

ERROR - 2013-08-26 13:10:20 --> Severity: Notice --> Use of undefined constant REQ - assumed 'REQ' /home/highland/public_html/system/expressionengine/libraries/Core.php 48

Is anyone else getting this in their logs? Have any idea how I can fix this or what it means?


  • 2
    Are you doing anything strange on that site? Does it happen on other sites? Does it happen on every single request, or only in certain situations? Aug 27 '13 at 6:24
  • I don't think anything I'm doing is strange on this site. It is happening on a couple other EE sites that I've checked on, as well. It is happening on every front-end request, not at all from CP requests. I created a new blank template, and went through disabling ALL add-ons and testing, and the log message still shows up. Aug 27 '13 at 14:03
  • I just set up an unchanged, basic installation of EE 2.6.1, and then set log_threshold to 1, and visited my site index page and the log message STILL comes up! If NO ONE else is seeing this, I'd suspect it's my local server XAMPP environment... however, it's happening on a live linux server as well... Aug 27 '13 at 14:04
  • I don't know if this is useful, but I turned log_threshold to 5, and the above error shows up first, before this output in the log file: DEBUG - 2013-08-27 10:59:02 --> Config Class Initialized Aug 27 '13 at 15:00
  • Oh, the 2nd time I loaded it, the error showed up further down in the log, between "Controller Class Initialized" and "Database Driver Class Initialized" DEBUG - 2013-08-27 11:01:07 --> Controller Class Initialized ERROR - 2013-08-27 11:01:07 --> Severity: Notice --> Use of undefined constant REQ - assumed 'REQ' /chroot/home/paleosun/devcds.paleosun.com/html/system/expressionengine/libraries/Core.php 48 DEBUG - 2013-08-27 11:01:07 --> Database Driver Class Initialized Aug 27 '13 at 15:02

This looks like an EE bug to me, I'd report it to EllisLab.

The error you are seeing comes from system/expressionengine/libraries/Core.php, on this line in the constructor:

@set_time_limit((REQ == 'CP') ? 300 : 90);

However, REQ isn't actually defined until the bootrap() method a bit further down:

public function bootstrap()
    // Define the request type
    // Note: admin.php defines REQ=CP
    if ( ! defined('REQ'))
        define('REQ', ((ee()->input->get_post('ACT') !== FALSE) ? 'ACTION' : 'PAGE')); 

So unless I'm missing something obvious, it seems correct to throw an error for accessing a constant before it has been defined. If this is a bug though, I'm surprised more people aren't reporting it.

  • Ok, thanks, Adrian. I feel a little less crazy. I reported it as a bug here: link Aug 27 '13 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.