This is an example recipe, which can be used as-is if needed, for adding PECL extensions to Zend Server, using Linux (CentOS) build tools and the Zend Server PHP tools (Sources, PECL, PHP Config, PHPIZE etc.).
The resulting module (PHP extension yaml.so) is binary compatible with matching RHEL version (7.9 in this example), so you can build on a CentOS machine and copy the PHP module to another CentOS / RHEL machine.
You will also need to install any system LIBRARY required by the PHP module(s) you add with the PECL tool - in this case you will need 'libyaml' package from the distro (see the LDD command on step 4 to verify dependencies).
You can of course modify the instructions for other Zend Server and PHP version combinations.
If you need to build a Debian / Ubuntu module, please be aware that the Zend and Linux package names may vary, but the same procedure applies.
# yum install gcc autoconf libyaml libyaml-devel php-dev-zend-server
# pecl channel-update pecl.php.net
# pecl install yaml
# ldd /usr/local/zend/php/7.3/lib/ext/yaml.so
# echo "extension=yaml.so" > /usr/local/zend/php/7.3/etc/conf.d/yaml.ini
# php -m | grep yaml
# php -r 'print_r(get_extension_funcs("yaml"));'
Installing Linux packages requires elevated credentials (root / sudo) - see the commands above with a preceding hash (#) suggesting that.
The commands in steps 6+7 can also be executed without root / sudo (regular user with /usr/local/zend/bin in the $PATH).
You will NOT see YAML in the PHP extensions under the Admin UI, as it is not in the blueprint (it is not in the original list of parsed modules).
You should see YAML section in the phpinfo() output.