Submitted by admin on Tue, 09/01/2020 - 10:42

Encountered numerous PHP syntax errors in Drupal 7 while checking the error log file:
[01-Sep-2020 17:31:23 Asia/Manila] PHP Parse error: syntax error, unexpected ''< /ul>'' (T_CONSTANT_ENCAPSED_STRING) in /home/website/public_html/modules/php/php.module(80) : eval()'d code on line 4 [01-Sep-2020 17:31:41 Asia/Manila] PHP Parse error: syntax error, unexpected ''< /ul>'' (T_CONSTANT_ENCAPSED_STRING) in /home/website/public_html/modules/php/php.module(80) : eval()'d code on line 4
While this can be specific to custom coding or even server-level, fixing this website or Drupal level might help.
Three solutions on how to avoid and/or fix the error:
- If website is running on PHP version lower than 7.x, try to switch PHP to version 7.x
This can be done for instance under CPanel > MultiPHP manager. If missing or you do not have access, ask your webhosting provider or another technical expert to do this for you.
- Turn off the PHP Filter module
You need to double-check though that this format is not being used in any blocks or nodes
Go to the module listing, disable or turn-off PHP Filter module
- Text Format hierarchy
If for some reason the PHP format is needed and used (although the first option is the best recommendation as enabling PHP filtering is a security risk), place the PHP format above all other formats in precedence.
Go to Configuration > Content Authoring > Text Formats
Then drag PHP code text format above all other formats
Save changes
Leave a Comment