0

iam using ZF 1.11.x on my local machine (osx) everything works like excepted, but when i deploy my application to the production server an error occures:

mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'Zend_View_Helper_Placeholder_Container_Exception' with message 'Cannot nest headScript captures' in /var/www/virtual/website/library/Zend/View/Helper/HeadScript.php:146

Iam using the viewHelper to set some variables inside my layout.phtml. I can fix it by putting them just in script tags but i like to know why this error happens..

1
  • show some code on what fixes it Commented Jan 8, 2012 at 10:44

2 Answers 2

1

According to the source code here this exception happens when you try to nest captureStart() calls.

Since it doesn't happen locally I suspect that your provider/production server has been setup in a specific manner - which often is the case when you don't use a dedicated root server...

Sign up to request clarification or add additional context in comments.

Comments

0

For us, this problem was caused due to short tags not being enabled for PHP.

Edit your php.ini, change "short_open_tag" to "on"

Basically we were using the following to end capture.

<? $this->inlineScript()->captureEnd(); ?> 

But if short tags aren't enabled, this wont be recognized and any subsequent call of $this->inlineScript()->captureStart(); will crash.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.