Download the Yaf extension
Extract and enter the directory
- tar -zxvf yaf-2.3.3.tgz
- cd yaf-2.3.3
phpize
- Run phpize in the current directory

Compile and install
- ./configure --with-php-config=$PHP_BIN/php-config
- If you do not know your PHP bin directory, use the Linux command find / -name php-config to locate it, copy the path, then press Enter (or use whereis php-config).

- Then run make && make install

- If you see the output shown above, installation succeeded.
Change the php.ini configuration
- Append extension=yaf.so to the file
- Restart PHP:/etc/init.d/php-fpm restart