PHP Agent Release Notes

 

Restart your web server if you have recently upgraded your agent. This will fix most reporting issues and will load the agent's new features and bug fixes.

PHP Agent Release Notes

Wednesday, September 5, 2018 - 12:00 Download

Bug Fixes

  • Fixed an entire category of bugs where a Drupal hook whose hook name matched its module name resulted in the generation of empty metric names.

Operating Systems Support

  • This release of the PHP Agent removes support for the Solaris operating system. For Solaris support, please install agent version 8.1 or prior.
Monday, April 30, 2018 - 12:00 Download

Upgrade Notices

  • The PHP Agent API call newrelic_set_appname has been updated with security improvements in anticipation of future releases.
Monday, March 12, 2018 - 15:44

Upgrade Notices

  • The newrelic.daemon.ssl ini setting has been removed to increase security. Transport Layer Security (TLS) will now always be used in communication with the New Relic collector.
  • Laravel Queue support has now been enabled for all users. If newrelic.feature_flag=laravel_queue is set, it will now be ignored.

Bug Fixes

  • On FreeBSD and Solaris, when newrelic.daemon.port is configured to use TCP to connect the agent to the daemon, the agent would have difficulty receiving application configuration data from the daemon due to the default timeout of 100 milliseconds matching the delay enforced by the FreeBSD kernel as part of its implementation of Nagle's algorithm. The PHP agent will now set the TCP_NODELAY flag when connecting to the daemon via TCP, which increases the reliability of the agent:daemon connection.
Wednesday, January 10, 2018 - 10:45

New Features

  • Support for PHP 7.2 has been added.

Bug Fixes

  • Datastore metrics would not be generated for Predis users who stopped and started the transaction after instantiating a Predis\Client object. This included users using the newrelic_set_appname() API. This has been fixed.
Tuesday, October 10, 2017 - 11:45

New Features

  • Internal functions can now be instrumented by enabling the newrelic.transaction_tracer.internal_functions_enabled configuration setting. When enabled, internal functions will appear in transaction traces like PHP functions.

    Note that enabling this option may result in transactions being slower, especially when collecting many traces from PHP 5.x. Enabling this option is only recommended when specifically debugging performance issues where an internal function is suspected to be slow.

Bug Fixes

  • In some cases, Magento 2's UI Component JSON data sources return with an (incorrect) Content-Type of text/html. This resulted in auto instrumentation insertions into JSON data that contained a <head> string. We now identify these specific JSON data sources and ensure the auto instrumentation is not inserted into this JSON data.

  • On PHP 7, using file_get_contents() to get a HTTP URL in a function which also read from $http_response_header resulted in the external call not being linked correctly in the APM UI: the external call would appear in transaction traces without a link to the receiving application. This has been fixed.

  • Using curl_setopt_array() to set options on a cURL handle could result in cross application tracing failing. This has been fixed.

  • When generating explain plans for queries issued with MySQLi, the PHP agent could bind parameters from the wrong query if the PHP object ID had been reused internally. This has been fixed.

  • Due to a change in Laravel 5.5's router API, the PHP agent would crash when automatically naming a Laravel transaction. This has been fixed.

  • On PHP 7, when naming transactions for the Laravel 5 framework, well-formed transaction names were being replaced by the too-generic $METHOD/index.php. This has been fixed.

  • Invoking newrelic_record_datastore_segment() before the PHP agent had connected to New Relic would result in the query callback silently failing to execute. This has been fixed; the callback will always be invoked provided parameters of the correct type are given to the function, otherwise an E_WARNING will be generated.

Tuesday, August 29, 2017 - 10:30

New Features

  • A new API function for timing datastore functions that the PHP agent doesn't natively instrument has been added: newrelic_record_datastore_segment(). Documentation and usage examples can be found on the New Relic Documentation site.

  • The agent now collects additional metadata when running within AWS, GCP, Azure, and PCF. This information is used to provide an enhanced experience when the agent is deployed on those platforms.

Bug Fixes

  • On Laravel 5.4, previous versions of the PHP agent named transactions handled by routes without explicit names based on the request method and front controller name, instead of using the route URI as with other versions of Laravel. This has been fixed, and automatic transaction names are once again consistent across all Laravel versions.

  • When generating explain plans for queries issued with MySQLi, the PHP agent could bind parameters from the wrong query if the PHP object ID had been reused internally. This has been fixed.

Wednesday, July 5, 2017 - 10:00

Bug Fixes

  • On the first request served by a PHP process, a Drupal 6 or 7 hook that was invoked with module_invoke() before it had been invoked by module_invoke_all() could have its module name reported as an empty string. This has been fixed.

  • On PHP 7.0 and 7.1, a Drupal 6 or 7 hook invoked via module_invoke_all() could report the module name as an empty string in some situations. This has been fixed.

Tuesday, June 27, 2017 - 16:50

Bug Fixes

  • Users of Guzzle 4 or 5 may have seen crashes in version 7.3.0 of the PHP agent due to a bug in the agent's request shutdown instrumentation for that library. This has been fixed.
Monday, June 26, 2017 - 10:20

Upgrade Notices

  • Laravel Queue instrumentation has been updated to better interoperate with other New Relic APM features. It is possible that messages sent from PHP installs running version 7.3 (or later) of the PHP agent may not be correctly linked to the message queue worker transaction if the worker is running with version 7.2 or earlier of the PHP agent.

    If you use the Laravel Queue instrumentation, we recommend ensuring that all agents used to produce and consume messages are upgraded to version 7.3 simultaneously to avoid unexpected service map issues.

Bug Fixes

  • Compatibility with extensions that install opcode handlers on PHP 7 has been improved, most notably with uopz. While we still do not recommend using other extensions that hook deeply into PHP (such as uopz, runkit, or xdebug) with the New Relic PHP agent, this change should result in improved functionality.

  • A potential segfault when using Predis in a session handler invoked at request shutdown has been fixed.

  • External requests issued using Guzzle 6 are now properly instrumented when the GuzzleHttp\Client class has been extended.

Wednesday, April 19, 2017 - 10:00

Upgrade Notices

  • Users of the newrelic-php5 Debian package with PHP 5.2: due to discontinued support of PHP 5.2, upgrading to version 7.x of the PHP agent may result in your applications no longer reporting to New Relic. We advise that you upgrade to a supported version of PHP.

    If upgrading PHP is not possible, you can use apt-get and dpkg to install version 6.9 of the PHP agent and then hold that installed version by running these commands as root:

    apt-get update
    apt-get upgrade newrelic-php5-common=6.9.0.182 newrelic-daemon=6.9.0.182 newrelic-php5=6.9.0.182
    echo 'newrelic-php5-common hold' | dpkg --set-selections

Bug Fixes

  • Automatic transaction naming has been fixed for Symfony 1 users who replaced the controller class via factories.yml with one that did not call sfFrontWebController::dispatch() or sfController::forward().

  • Datastore metrics could not be generated for Predis 0.7 and 0.8 in version 7.1 of the PHP agent. This has been fixed.

  • The agent would not report Zend_Http_Client external calls when the Zend Framework was used directly as a library or indirectly by a framework like Symfony or Magento. This has been fixed.

Thursday, March 23, 2017 - 10:35

New Features

  • Added support for the MongoDB library

    The PHP agent now supports the MongoDB userland library, which is the recommended interface to the mongodb extension. Users of this library will see new metrics in the Databases tab, nodes in transaction traces, and breakdown metrics on individual transaction pages.

  • Database instance information available for Redis, Predis, and MongoDB

    Queries and commands issued using the PECL Redis extension, the Predis library, and the MongoDB library now capture instance information. Transaction traces now include the name of the host (including the port or socket) and database that the query was run against.

    Collection of host information can be disabled by setting newrelic.datastore_tracer.instance_reporting.enabled = false in the newrelic.ini. Similarly, the database name can be omitted with newrelic.datastore_tracer.database_name_reporting.enabled = false.

Upgrade Notices

  • Commands in Predis pipelines are now reported individually, rather than being rolled into a single pipeline query.

Bug Fixes

  • When using PHP 7.0 or 7.1, calling curl_setopt() with the CURLOPT_HTTPHEADER option and an array with elements that have been accessed by reference (for example, with foreach ($array as $k => &$v)) would result in the headers used by New Relic to track external calls overwriting other custom headers. This has been fixed.
Tuesday, February 21, 2017 - 09:35

New Relic PHP Agent Release Notes

End of Life Notices

  • The New Relic PHP agent no longer supports PHP 5.2. New Relic highly encourages upgrading to a supported version of PHP - 5.6 or higher. If you would like to continue running the New Relic PHP agent with PHP 5.2, we recommend using version 6.9 of the agent, however please note that we can only offer limited support in this case.

New Features

  • Automatic transaction naming for Magento 2 has been improved. Previously, only requests that were handled by Magento's normal routing were automatically named, which resulted in request types that utilized Magento's interceptor/plugin functionality being named as unknown. This primarily affected users of the REST or SOAP web services.

    REST and SOAP requests will now be named in the Webapi/Rest and Webapi/Soap namespaces, respectively, and will be named according to the service class and method that handle the request.

    Third party modules that add an interceptor on Magento\Framework\App\FrontControllerInterface to override the dispatch() method will result in transaction names that are based on the interceptor class name. New Relic recommends using the newrelic_name_transaction() API function from within the module to name the transaction if you require more precision.

Thursday, January 19, 2017 - 11:15

End of Life Notices

  • Support for PHP 5.2 in the New Relic PHP agent is deprecated and will be removed in a future version. New Relic highly encourages upgrading to a supported version of PHP - 5.6 or higher. If you would like to continue running the New Relic PHP agent with PHP 5.2, we recommend using version 6.9 of the agent, however please note that we can only offer limited support in this case.

New Features

  • Instance information for the pgsql and PDO pgsql extensions is now captured. Slow database queries and transaction traces now include the name of the host (including the port or socket) and database that the query was run against.

    Collection of host information can be disabled by setting newrelic.datastore_tracer.instance_reporting.enabled = false in the newrelic.ini. Similarly, the database name can be omitted with newrelic.datastore_tracer.database_name_reporting.enabled = false.

Wednesday, November 9, 2016 - 11:15

End of Life Notices

  • Support for PHP 5.2 in the New Relic PHP agent is deprecated and will be removed in a future version. New Relic highly encourages upgrading to a supported version of PHP - 5.6 or higher. If you would like to continue running the New Relic PHP agent with PHP 5.2, we recommend using version 6.8 of the agent, however please note that we can only offer limited support in this case.

New Features

  • Support for PHP 7.1 has been added.

  • The elapsed time after which an application will be considered inactive can now be configured using the newrelic.daemon.app_timeout setting. This setting is useful when the only transactions being executed are very infrequent, such background processing using a cron job. Previously, an application was considering inactive after ten minutes with no transactions.

  • Instance information for the mysql, mysqli, and PDO mysql extensions is now captured. Slow database queries and transaction traces now include the name of the host (including the port or socket) and database that the query was run against.

    Collection of host information can be disabled by setting newrelic.datastore_tracer.instance_reporting.enabled = false in the newrelic.ini. Similarly, the database name can be omitted with newrelic.datastore_tracer.database_name_reporting.enabled = false.

Bug Fixes

  • Automatic transaction naming for MediaWiki versions 1.18 and later was broken in version 6.3 of the New Relic PHP agent. This has been fixed.
Wednesday, September 21, 2016 - 11:00

New Features

  • PHPUnit test events

    Support has been added for the popular unit test library PHPUnit (versions 3.7 to 5.5, inclusive). When enabled, the agent reports test results as custom Insights events. Test suite summary data are sent as TestSuite events, while individual test cases are sent as Test events.

    You can enable this feature in your newrelic.ini file with newrelic.phpunit_events.enabled = true. Depending on your events retention policy, enabling this setting may impact your New Relic billing statement.

    Read more about this feature on our documentation site.

  • Support has been added for Slim Framework 2.x and 3.x.

Upgrade Notices

Bug Fixes

  • Automatic page load timing instrumentation was broken on PHP 5.4-7.0 in certain edge cases: most notably, when the <head> element was not in the first 40kB of the page content, or when the </body> element was not in the last few kilobytes of content. This has been fixed.

  • Prevent real user monitoring JavaScript injection when the Content-Type is first set to text/html then subsequently changed to something else (for example, application/json). This was a regression introduced in version 6.2.

Thursday, August 25, 2016 - 16:00

Bug Fixes

  • When using version 6.6.0 of the PHP agent, instantiating a PDO object with options set could result in PHP crashing at the end of handling a request. This has been fixed.
Tuesday, August 23, 2016 - 11:20

New Features

  • Support has been added for Laravel 5.3.

  • Experimental Laravel Queue support.

    Experimental support for the Laravel Queue component has been added. This supports all versions of Laravel from 4.0 to 5.3, inclusive.

    Whether run via artisan queue:listen or artisan queue:work, queue workers will now generate a separate background transaction for each job that is processed. These transactions will be named with the class name of the job, or IlluminateQueueClosure if a closure was queued.

    Additionally, a transaction that queues one or more jobs will be linked to the background transaction(s) that processed those jobs on the transaction map in the New Relic UI.

    To enable this support, you will need to set the laravel_queue feature flag in newrelic.ini. For most users, this will simply involve adding this line:

    newrelic.feature_flag=laravel_queue

    As this is presently an experimental feature, we would welcome feedback — both positive and negative — on whether this feature helps users using the Laravel Queue component better visualise the structure and performance of their applications.

    If all goes well, it is anticipated that Laravel Queue support will be enabled by default in a future version of the agent.

Upgrade Notices

  • Symfony 1 transactions that generate 404 errors due to no routes being matched will now be named based on the module and action that are actually used, rather than the module and action inferred from the request URL. In most cases, this will result in the transaction name being based on the error_404_module and error_404_action Symfony settings.

    Note that, as a result of this change, if the configured 404 action calls sfAction::forward() to forward to another action, the transaction name will be based on the final action. All other uses of sfAction::forward() are unaffected.

Bug Fixes

  • Previously, calling PDO::query with more than one argument resulted in the query being counted under the 'other' category on the Datastores page in the New Relic UI. This has been fixed. The agent will now correctly categorize the query as 'select', 'insert', 'update', or 'delete'.

  • Previously, calling PDO::query with more than one argument resulted in the agent reporting "(unknown sql)" if the query was slow. (i.e., it exceeded the threshold given by the newrelic.transaction_tracer.explain_threshold setting.) This has been fixed.

  • Previously, calling SQLite3::querySingle with two arguments resulted in the query being counted under the 'other' category on the Datastores page in the New Relic UI. This has been fixed. The agent will now correctly categorize the query as 'select', 'insert', 'update', or 'delete'.

  • Previously, calling SQLite3::querySingle with two arguments resulted in the agent reporting "(unknown sql)" if the query was slow. (i.e. It exceeded the threshold given by the newrelic.transaction_tracer.explain_threshold setting.) This has been fixed.

  • Transient Magento 2 tables now have the unique numbers removed from their names to avoid metric grouping issues.

  • Pressflow 6 applications were incorrectly detected as Drupal 7 applications. This could cause POST requests made using drupal_http_request to be converted into GET requests. This has been fixed.

  • Explain plan generation is now always performed on a separate database connection. This has been changed to avoid issues when using MySQL's SELECT FOUND_ROWS() feature.

  • Previously, instrumenting method calls that resolved to __call() or __callStatic() calls could result in crashes on PHP 7. This primarily manifested in crashes for users of certain WordPress plugins (for example, wp-external-links) that registered hooks or actions that used magic methods. This has been fixed.

Thursday, July 28, 2016 - 12:00

New Features

Bug Fixes

  • The behavior of the installer when attempting to detect PHP installations has been tightened up. Previously, a directory structure such as /usr/local/php/php/* would be detected as an installation of PHP in /usr/local/php, as the nested php directory would be wrongly assumed to be a PHP CLI binary. The installer now checks if the nested php (or php-config) is a directory, and ignores the path if so.

    Although this is likely to improve the installer in multiple environments, most noticeably, this fix removes erroneous messages about there being multiple PHP installations when installing the PHP agent within the Docker Hub's official PHP images.

  • Spurious messages like ALERT: oops, unknown child could appear in the PHP FPM log when a New Relic daemon process was started. This has been fixed.

Tuesday, June 14, 2016 - 10:55

New Features

  • Ignore Errors

    A new newrelic.error_collector.ignore_errors setting has been added. When configured, this setting can be used to prevent errors, such as E_WARNING, from being reported to New Relic. This setting does not affect errors reported via the newrelic_notice_error API.

  • Ignore Exceptions

    A new newrelic.error_collector.ignore_exceptions setting has been added. This setting accepts a comma-separated list of fully-qualified class names. When an uncaught exception occurs, the agent will not report the exception to New Relic if it is an instance of a class in this list. This setting does not affect errors reported via the newrelic_notice_error API.

Upgrade Notices

  • Guzzle support is now enabled by default. It can be disabled by setting the new newrelic.guzzle.enabled setting to false.

    The guzzle feature flag that was previously used to enable Guzzle support is now ignored.

Bug Fixes

  • The first request in each PHP process would remove any output handlers installed using the output_handler configuration setting for users of PHP 5.4 and later. This has been fixed: existing output handlers will now remain untouched.

  • Transient WordPress hooks now have the unique numbers removed from their names to avoid metric grouping issues.

  • In cases where WordPress' WP_CONTENT_DIR directory was set to a custom value, WordPress plugin metrics were not reported on PHP 5.2 to 5.4, inclusive. This affected users of the popular WP-Skeleton project. This has been fixed.

  • A regression in version 6.3 could cause Guzzle 6 users to lose support for cross application tracing and service maps, in particular when Guzzle 6 was autoloaded as a result of instantiating the only GuzzleHttp\Client object used within the lifetime of the script. This has been fixed.

Wednesday, May 18, 2016 - 10:55

New Features

  • Support for Postgres prepared statements has been added when the pg_prepare and pg_execute functions are used. The agent will now report Datastore metrics as well as capture slow queries.

Bug Fixes

  • Added a workaround for a stack corruption bug in very old versions of the Suhosin extension when used with PHP 5.3 or higher. The bug exists in Suhosin 0.9.29 and older versions only. Newer versions are not affected.

  • Automatic transaction naming could fail in certain circumstances on Laravel 4.1 or higher on PHP 5 when a before route filter was installed. This has been fixed.

  • Automatic transaction naming could fail on Laravel 5.x when a global middleware handled the request without forwarding it deeper into the application. For example, the default Authenticate middleware returns a 401 Forbidden response to unauthenticated requests, preventing proper transaction naming. This has been fixed.

  • A segfault could occur in memory constrained environments, particularly on PHP 7. This has been fixed.

Pages