Skip to content

Commit 380774d

Browse files
PROFeNoMbwoebi
andauthored
fix(benchmarks): Ensure OPCache is used in cgi-fcgi web servers (#2538)
* 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 <[email protected]> * Remove unused env var --------- Co-authored-by: Bob Weinand <[email protected]>
1 parent 527e4d9 commit 380774d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Common/WebFrameworkTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ protected static function getEnvs()
9494
*/
9595
protected static function getInis()
9696
{
97+
$enableOpcache = \extension_loaded("Zend OpCache");
98+
9799
return [
98100
'ddtrace.request_init_hook' => realpath(__DIR__ . '/../../bridge/dd_wrap_autoloader.php'),
99101
// The following values should be made configurable from the outside. I could not get env XDEBUG_CONFIG
@@ -102,7 +104,7 @@ protected static function getInis()
102104
'xdebug.remote_enable' => 1,
103105
'xdebug.remote_host' => 'host.docker.internal',
104106
'xdebug.remote_autostart' => 1,
105-
];
107+
] + ($enableOpcache ? ["zend_extension" => "opcache.so"] : []);
106108
}
107109

108110
/**

0 commit comments

Comments
 (0)