diff --git a/src/providers/php/mod.rs b/src/providers/php/mod.rs index 4ea492be1..85cb0af7c 100644 --- a/src/providers/php/mod.rs +++ b/src/providers/php/mod.rs @@ -226,9 +226,13 @@ impl PhpProvider { let composer_json: ComposerJson = app.read_json("composer.json")?; let version = PhpProvider::get_php_version(app)?; let mut extensions = Vec::new(); + // ext-json is included by default in PHP >= 8.0 (and not available in Nix) + // ext-zend-opcache is included by default in PHP >= 5.5 + let ignored_extensions = [String::from("ext-json"), String::from("ext-zend-opcache")]; for extension in composer_json.require.keys() { - // ext-json is included by default in PHP >= 8.0 (and not available in Nix) so skip over it - if extension.starts_with("ext-") && (version == "7.4" || extension != "ext-json") { + if extension.starts_with("ext-") + && (version == "7.4" || !ignored_extensions.contains(extension)) + { extensions.push( extension .strip_prefix("ext-")