ERROR: Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead...

Hi, i am new to SuiteCRM and i made a fresh install using Softacolous, i am using SIteground as hosting provider.

After installation and configuration i have the following error message everywhere in Suite CRM:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/pegasus3/public_html/crm/include/Smarty/Smarty_Compiler.class.php on line 268

I have contacted Siteground support and this is what they told me:

The depricated warning message you are receiving is due to the fact that the file in question:

/home/pegasus3/public_html/crm/include/Smarty/Smarty_Compiler.class.php on line 268

is using a deprecated PHP method or in this case a flag for execution of the preg_replace() function. It is coding error and not a server-side one and I will recommend you to get in touch with the developers of the application for further information on how it can be fixed. In most cases, dropping the e flag would be sufficient, but again, it is up to the developers of the app to decide how to correct this.

So how to sole the issue ? Thanks to anybody that might be of any help on this

I am having this exact same error. Please help.

HI askesis83 / scattergood,

I am also facing the same problem did you guys got any solution on this issue.

Dear All,

I have resolved this issue by replacing the code in include/Smarty/Smarty_Compiler.class.php file. I replaced the code on line numbers from 262 to 268 with the below mentioned code. After that clear delete all the files which are in the cache folder and reload the page. This issue will be resolved.

    /* replace special blocks by "{php}" */ 
        $source_content = preg_replace_callback($search, create_function ('$matches', "return '" 
                                                . $this->_quote_replace($this->left_delimiter) . 'php' 
                                                . "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'" 
                                                . $this->_quote_replace($this->right_delimiter) 
                                                . "';") 
                                                , $source_content);

Regards,
Sandeep Shivhare