简体   繁体   English

启用newrelic后,Zend Framwork崩溃了

[英]Zend Framwork crashed when newrelic was enabled

I created a new ZF1 application (1.12.0) with zf tool like this: 我使用如下zf工具创建了一个新的ZF1应用程序(1.12.0):

zf create project test

I then enabled the layout as follow: 然后,我启用了布局,如下所示:

zf enable layout

And when I enabled newrelic I got this error: 当我启用newrelic时,出现此错误:

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

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. New Relic命名Zend事务的方式是挂接到Zend_Controller_Plugin_Broker::routeShutdown()并查看该函数接收的单个参数(即请求Zend_Controller_Plugin_Broker::routeShutdown()中的各种方法。 That parameter is supposed to be a class that has several methods: getModuleName() , getControllerName() , and getActionName() . 该参数应该是具有多个方法的类: getModuleName()getControllerName()getActionName() The PHP agent expects to be able to call all of those functions on the request. PHP代理希望能够根据请求调用所有这些功能。

If you have highly customized your Zend framework installation, you may need to resort to naming your transaction manually. 如果您高度定制了Zend框架安装,则可能需要求助于手动命名事务。 In this case, in your PHP INI file set newrelic.framework = "none" and at an appropriate place in your router, call newrelic_name_transaction() . 在这种情况下,请在您的PHP INI文件中设置newrelic.framework = "none"并在路由器的适当位置调用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: 有关此API调用以及其他API调用的更多信息,请参见New Relic KB:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM