CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
Pages: [1] 2

Author Topic: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270  (Read 3390 times)

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 13, 2011, 11:07:02 am
So I'm getting this on both an attempted upgrade and a completely fresh install and it was working just fine with the previous version.  (I know this is a cross-post. It happened with both an upgrade from J1.6.1 to 1.6.3 AND a fresh install of 1.6.3/4.0.1)

One of my clients started getting a smarty error with one of their event registrations, so I found a post on here where it was recommended that I clean the template_c folder out. I did, and started getting this error which completely crashes the Joomla backend:

Fatal error: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code: '{php' . str_repeat(&quot; &quot;, substr_count('{* Check for Status message for the page (stored in session-&gt;getStatus). Status is cleared on retrieval. *}', &quot; &quot;)) .'}' in /home/danetidw/public_html/novemberllc/jointcra/administrator/components/com_civicrm/civicrm/packages/Smarty/Smarty_Compiler.class.php on line 270

I thought it might be a problem with my installation, so I went and did a clean install of Joomla 1.6.3 and CiviCRM 4.0.1. Click on the civicrm menu item in the backend and it again completely crashes the Joomla admin backend with the same error.

tjhellmann

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.0.1
  • CMS version: Drupal 7.x
  • MySQL version: 5.0
  • PHP version: 5.3.x
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 13, 2011, 07:27:51 pm
Same issue for me but with Drupal. Running Drupal 7.0 and upgraded from 4.0 to 4.0.1 and getting the same error. Tried a clean install and same exact error. Can't access CiviCRM backend at all.

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 13, 2011, 07:51:44 pm
It has to be something with CiviCRM as I've tried installing it in three different directories, all fresh installs, deleting everything unused on my server -- I've done everything I can possibly think of that might have been a server setup issue.

As it is, unless its a misconfiguration by my hosting company that I can't fix, the most recent version of Joomla with the CiviCRM component is completely useless.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 13, 2011, 08:36:57 pm

i just downloaded and installed joomla 1.6.3 and civicrm 4.0.1 on my local macbook (using macports). things installed and worked fine

have no idea on the below error and why. Seems like its coming from deep withi smarty code, also seems wierd that its dying on an comment line

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 14, 2011, 10:51:52 am
Maybe a change in the template engine? Was there updated Smarty code added in the last update? I found a (not very) similar issue with another CMS and they tracked it down to an update to Smarty causing the error.

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 14, 2011, 10:57:35 am
I posted the issue on smarty.net. I'll update on here if there's any relevant response.

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 15, 2011, 04:56:46 pm
ok -- 60 topic views over on smarty.net and not one response. i don't think they're much interested in helping.  I also tried installing joomla/civicrm through normal methods (download, ftp, self-installer, installer for civi). The install went fine but clicking on "Configuration Checklist" or the Joomla Admin link and it errors out again.

I've tried this four different ways now and it doesn't work. I don't seem to be getting anywhere and my client's donation pages have been down for three days now with no solution or even ideas as to what the issue is.  I'm going to just have to switch to another system.
« Last Edit: May 15, 2011, 05:35:59 pm by danetidwell »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 15, 2011, 08:22:32 pm

If you have php skills or have access to someone who does, might be easier to try to track and figure out what is happening and why. It does help to have access to a working install so you can check what happens to that part of the code when things are working vs when its not working

It does help projects like Smarty and Civi if folks can investigate and figure out whats happening in cases like this where the error is sporadic / random (untill someone figures out what/why etc). Does not help that it works for us locally :(

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

danetidwell

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 2
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 16, 2011, 10:13:23 am
Thanks Lobo --

Strangely, it was the web host.  They upgraded the php security on my server. PHP 5.2.9 suhosin blocks the eval command so to rectify, your host has to allow a custom php.ini to be installed in each of the directories that CiviCRM is in.

I've attached mine as a txt file, but a2 said the code would probably depend on the provider.
« Last Edit: May 16, 2011, 11:03:20 am by danetidwell »

tjhellmann

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.0.1
  • CMS version: Drupal 7.x
  • MySQL version: 5.0
  • PHP version: 5.3.x
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 17, 2011, 01:04:42 pm
@danetidwell – thanks so much for troubleshooting this. Turns out my issue was the same. This install is hosted with A2 as well and they provided me the php.ini file and now all is working again.

From A2: "Eval has indeed been blocked by default on our servers since it is unsafe and accounts for over 95% of the malicious activity and hacked sites on our servers. We strongly recommend that you try to avoid its use."

They provided the php.ini file and Civi is up and running again. Thanks for tracking this down!

C. Scott Asbach

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal6
  • MySQL version: 5.0.91
  • PHP version: 5.2.9
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 17, 2011, 01:13:08 pm
Quote from: danetidwell on May 16, 2011, 10:13:23 am
Thanks Lobo --

Strangely, it was the web host.  They upgraded the php security on my server. PHP 5.2.9 suhosin blocks the eval command so to rectify, your host has to allow a custom php.ini to be installed in each of the directories that CiviCRM is in.

I've attached mine as a txt file, but a2 said the code would probably depend on the provider.

I am having this exact problem with CiviCRM 3.4 on Drupal 6 and my client's host is a2 as well.  I've tried using the php.ini you provided but it hasn't worked. I've tried putting it in the civicrm directory and in the directory the civicrm directory is in. Am I not putting this in the right place?

Also, I've looked at suhosin configuration instructions and it looks like you would need a directive like this:

suhosin.executor.disable_eval = false

But I don't see any mention of suhosin. I'm probably missing something because I am in a hurry (trying to launch my clients site asap).  Any more specific information on how this fixed it for you would be greatly appreciated.

C. Scott Asbach

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal6
  • MySQL version: 5.0.91
  • PHP version: 5.2.9
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
May 17, 2011, 01:16:53 pm
Of course, the next thing I try worked :P I just put the php.ini you provided in my Drupal directory.  While I am ecstatic this has fixed the site for my client, I'm assuming this inevitably opens up a security vulnerability. I guess I'll have to stay tuned and see if an update fixes this issue so I can remove the php.ini later.

mirrorstage

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
  • CiviCRM version: 4.6.7
  • CMS version: Drupal 6.37
  • MySQL version: 5.6.23
  • PHP version: 5.4.42
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
June 02, 2011, 03:05:34 pm
I was also experiencing this same issue when upgrading from 3.4.0 to 3.4.1 on Drupal 6.22 on shared hosting provided by A2Hosting.

Somehow, somewhere along the line, my PHP version got switched from 5.3.4 to the default of 5.2.9 without my knowledge. I was able to easily install the php.ini file as suggested above, and discovered the version change and switched it back to 5.3.4. Everything seems hunky-dory now, after several days of pulling my hair out trying to get the upgrade to install and work correctly.

Thank you all for trouble-shooting, figuring out and providing the solution!

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
July 29, 2011, 11:28:29 am
Great job posting this fix - just hit this for a client on A2.  I would add that I added:
Code: [Select]
#Deny php.ini
<files php.ini>
  order deny,allow
  deny from all
</files>
to .htaccess to prevent display of the php.ini file.  Is http://issues.civicrm.org/jira/browse/CRM-7964 the ticket to make this no longer needed?
Lead Developer, C3 Design.
Twitter: @FatherShawn

mirrorstage

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
  • CiviCRM version: 4.6.7
  • CMS version: Drupal 6.37
  • MySQL version: 5.6.23
  • PHP version: 5.4.42
Re: Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270
July 29, 2011, 12:01:32 pm
Thanks for your addition! I'm still novice enough that I wouldn't have realized that was a potential security risk, and I added your code to my .htaccess file. So happy when we're able to figure out the fix!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade to J1.6.3/CiviCRM 4.0.1 Error: Smarty_Compiler.class.php on line 270

This forum was archived on 2017-11-26.