0

We recently migrated one of our websites using EE to a new server running php7. We're getting the following error:

Fatal error: Cannot use EllisLab\ExpressionEngine\Library\Parser\Conditional\Token\Bool as Bool because 'Bool' is a special class name in /home/.../public_html/system/EllisLab/ExpressionEngine/Library/Parser/Conditional/Lexer.php on line 9

Here is line 9 from Lexer.php :

use EllisLab\ExpressionEngine\Library\Parser\Conditional\Token\Bool;

I tried setting 'allow_extensions' to 'n' and nothing changed. Also, I am able to log into the back-end.

Running EE version 2.10.2

It seems that using 'Bool' is no longer supported in php7. Does anyone know of a solution? Is there a fix for this in EE3?

Thanks.

2
  • Tell us what version of EE you're using too pls. Aug 29, 2017 at 8:20
  • Running ver 2.10.2
    – sdco
    Aug 29, 2017 at 13:02

1 Answer 1

1

For anyone that may come across this error in the future, we were able to resolve it by changing all instances of 'Bool' and 'String' that were inside the system>EllisLab folder to 'Boolean' and 'StringLiteral' respectively. Bool and String are reserved terms in PHP 7 and their usage in these 4 files (Lexer.php, Parser.php, Bool.php, String.php) was causing errors, so changing them to the updated terms resolved it.

We were using a bit of an older version of EE (2.10.2). I believe these terms are updated in the latest versions though.

1
  • It help.. thanks.. but i still got many php errors as Message: Object of class EllisLab\ExpressionEngine\Library\Parser\Conditional\Token\Variable could not be converted to string
    – Benoit L
    Jul 12, 2018 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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