sbarrat
sbarrat

Reputation: 109

Zend Framwork crashed when newrelic was enabled

I created a new ZF1 application (1.12.0) with zf tool like this:

zf create project test

I then enabled the layout as follow:

zf enable layout

And when I enabled newrelic I got this error:

PHP Error:
Uncaught exception 'Zend_Layout_Exception' with message 'Invalid method 'getmodulename' called on layout action helper' /usr/local/zend/share/ZendFramework/library/Zend/Layout/Controller/Action/Helper/Layout.php : 184

Upvotes: 1

Views: 318

Answers (1)

Steven
Steven

Reputation: 1071

The way in which New Relic names Zend transactions is to hook into Zend_Controller_Plugin_Broker::routeShutdown() and look at various methods in the single argument that that function receives, which is the request. That parameter is supposed to be a class that has several methods: getModuleName(), getControllerName(), and getActionName(). The PHP agent expects to be able to call all of those functions on the request.

If you have highly customized your Zend framework installation, you may need to resort to naming your transaction manually. In this case, in your PHP INI file set newrelic.framework = "none" and at an appropriate place in your router, call newrelic_name_transaction(). You may be able to avoid this by determining why your request object does not have those standard functions.

One possible reason that this may occur is because you have an incomplete overloaded plugin router.

More information on this API call as well as others can be found in the New Relic KB:

https://newrelic.com/docs/php/new-relic-for-php

Upvotes: 6

Related Questions