下载YAF扩展安装包
一、下载
获取YAF扩展的安装包
访问PECL官方资源库:http://pecl.php.net/package/yaf
从中挑选并下载你所需的特定版本压缩包
wget http://pecl.PHP.net/get/yaf-2.3.5.tgz
tar zxvf yaf-2.3.5.tgz
cd yaf-2.3.5
二、安装

#whereis phpize
/data/yaf-2.3.5# /usr/bin/phpize
#whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
/data/yaf-2.3.5# ./configure --with-php-config=/usr/bin/php-config
/data/yaf-2.3.5# make && make install
针对安装过程中可能遇到的障碍,可参考以下解决方案:
在执行最终编译指令时,有时会遭遇编译中断报错,例如显示:compilation terminated. make: * [yaf_router.lo] Error 1
sudo apt-get install libpcre3 libpcre3-dev openssl libssl-dev
此时需重新运行最后一条关键命令以完成构建
若操作顺利,终端输出应呈现如下正常状态:

也可以执行以下make test
此外,还可能遇到因权限不足导致的错误:cp:cannot create regular file ‘/usr/lib/php5/20121212/#INST@13121#':Permission denied
该提示表明当前用户缺乏root权限。可通过su命令切换至root账户并输入密码解决;若遗忘密码,可使用sudo passwd root进行重置
随后需在php.ini配置文件中加入相应的扩展加载指令
extension=yaf.so
若不确定php.ini的具体路径,可通过查看phpinfo页面信息来定位

配置完成后,务必重启Web服务器以使更改生效

上述即为在Ubuntu系统中安装YAF扩展的全部操作步骤,旨在为读者提供实用参考,欢迎收藏支持。