本文主要为大家分享一篇Ubuntu上安装yaf扩展的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧,希望能帮助到大家。
一、下载
yaf扩展下载地址
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 1sudo 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,输入root密码即可,忘记密码可以重设:sudo passwd root
在php.ini中添加:extension=yaf.so
如果不知道php.ini在哪儿,可以看phpinfo
![e5528ca92e1313fdd64dc39793f5b0b8.png](https://img8.php1.cn/3cdc5/15d29/978/f788dca7dc2d3c41.jpeg)
最后,重启服务器
![bd9eec13e7169cfa2d9631f822a46feb.png](https://img8.php1.cn/3cdc5/15d29/978/f6f2d1ef1b3e2066.jpeg)
相关推荐: