https://github.com/php/pie allows extensions to be installed from packagist. cargo-php could include a template that generates the files needed.