fn get_ext_dir() -> AResult<PathBuf> {
    let cmd = Command::new("php")
        .arg("-r")
        .arg("echo ini_get('extension_dir');")
        .output()
        .context("Failed to call PHP")?;
    if !cmd.status.success() {
        bail!("Failed to call PHP: {:?}", cmd);
    }
    let stdout = String::from_utf8_lossy(&cmd.stdout);
    let ext_dir = PathBuf::from(&*stdout);
    if !ext_dir.is_dir() {
        if ext_dir.exists() {
            bail!(
                "Extension directory returned from PHP is not a valid directory: {:?}",
                ext_dir
            );
        }

        std::fs::create_dir(&ext_dir).with_context(|| {
            format!(
                "Failed to create extension directory at {}",
                ext_dir.display()
            )
        })?;
    }
    Ok(ext_dir)
}
Returns the path to the extension directory utilised by the PHP interpreter,
creating it if one was returned but it does not exist.
crates/cli/src/lib.rs