phplaravelinvalidargumentexception

Laravel InvalidArgumentException in RouteRegistrar.php line 75:


I keep getting this error when trying to deploy a laravel application to a production server:

InvalidArgumentException in RouteRegistrar.php line 75:

in RouteRegistrar.php line 75
at RouteRegistrar->attribute('after', object(AfterFilter)) in Router.php line 1085
at Router->__call('after', array(object(AfterFilter))) in BootProviders.php line 17
at Router->after(object(AfterFilter)) in BootProviders.php line 17
at Application->boot() in BootProviders.php line 17
at BootProviders->bootstrap(object(Application)) in Application.php line 208
at Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders')) in Kernel.php line 160
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54

The strange thing is that I do not get this error on my local machine. The PHP version of my machine and the production server is nearly identical (5.6.25 on the server and 5.6.26 on my machine).

Does anyone have any idea what could be causing this error?


Solution

  • After some more research the source of the problem seems to be an old version of New Relic that was installed on the server. https://discuss.newrelic.com/t/php-agent-breaks-laravel-5-2/32801