diff --git a/ext/opcache/tests/issue0115.phpt b/ext/opcache/tests/issue0115.phpt index 5e32e1f6fb66d..c31f72e8c63b0 100644 --- a/ext/opcache/tests/issue0115.phpt +++ b/ext/opcache/tests/issue0115.phpt @@ -33,7 +33,13 @@ $p->setStub($stub); unset($p); include "php_cli_server.inc"; -php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX); + +$ini = '-d opcache.enable=1 -d opcache.enable_cli=1'; +if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) { + $ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX; +} +php_cli_server_start($ini); + echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_1.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_2.phar.php'); ?> diff --git a/ext/opcache/tests/issue0149.phpt b/ext/opcache/tests/issue0149.phpt index a72a4bc4ee650..29e6f02808a75 100644 --- a/ext/opcache/tests/issue0149.phpt +++ b/ext/opcache/tests/issue0149.phpt @@ -21,7 +21,13 @@ $p->setStub($stub); unset($p); include "php_cli_server.inc"; -php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX); + +$ini = '-d opcache.enable=1 -d opcache.enable_cli=1'; +if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) { + $ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX; +} +php_cli_server_start($ini); + echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');