Networknet archive Blog

CMSMadeSimple: Parse error in Smarty_Compiler.class.php

Originally published Last updated

I recently updated one of my CMSMadeSimple websites. After the update, I encountered this error:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/ivan/site/lib/smarty/Smarty_Compiler.class.php(270) : regexp code on line 5
Fatal error: preg_replace() [function.preg-replace]: Failed evaluating code: '{php' . str_repeat(" ", substr_count('{* You can also instantiate custom behaviour on a module by module basis by looking at the $entry->module and $entry->modulerecord fields in $entry ie: {if $entry->module == ''News''}{News action=''detail'' article_id=$entry->modulerecord detailpage=''News''} *}', " ")) .'}' in /home/www/ivan/site/lib/smarty/Smarty_Compiler.class.php on line 270

Search did not work, and the system stopped with the error above. I reinstalled a completely new version of CMSMadeSimple but encountered more errors. They were all related to comments in the template or the search “Result Template” area.

Remove the template comment

  1. Log in to the CMSMadeSimple Admin page.
  2. Open Extensions / Search and click “Result Template”.
  3. Remove the comment from {* to *} and submit the change.

image

Try searching the website again. This solved my problem.

The issue involves single quotes in combination with the MySQL and Apache version. I hope readers can add more information in the comments.