Skip to content

Commit

Permalink
fix(benchmarks): Ensure OPCache is used in cgi-fcgi web servers (#2538)
Browse files Browse the repository at this point in the history
* fix(benchmarks): Ensure OPCache is used in cgi-fcgi web servers

* Use zend_extension=opcache.so instead

* Check if Zend OpCache is loaded

Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com>

* Remove unused env var

---------

Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com>
  • Loading branch information
PROFeNoM and bwoebi committed Feb 26, 2024
1 parent 527e4d9 commit 380774d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Common/WebFrameworkTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ protected static function getEnvs()
*/
protected static function getInis()
{
$enableOpcache = \extension_loaded("Zend OpCache");

return [
'ddtrace.request_init_hook' => realpath(__DIR__ . '/../../bridge/dd_wrap_autoloader.php'),
// The following values should be made configurable from the outside. I could not get env XDEBUG_CONFIG
Expand All @@ -102,7 +104,7 @@ protected static function getInis()
'xdebug.remote_enable' => 1,
'xdebug.remote_host' => 'host.docker.internal',
'xdebug.remote_autostart' => 1,
];
] + ($enableOpcache ? ["zend_extension" => "opcache.so"] : []);
}

/**
Expand Down

0 comments on commit 380774d

Please sign in to comment.