服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|JAVA教程|ASP教程|

服务器之家 - 编程语言 - PHP教程 - Ubuntu上安装yaf扩展的方法

Ubuntu上安装yaf扩展的方法

2019-10-24 16:01jingxian PHP教程

下面小编就为大家分享一篇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

二、安装

Ubuntu上安装yaf扩展的方法

#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

再执行最后一条命令。

一切顺利的话,应该是这样的:

Ubuntu上安装yaf扩展的方法

也可以执行以下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

Ubuntu上安装yaf扩展的方法

最后,重启服务器

Ubuntu上安装yaf扩展的方法

以上这篇Ubuntu上安装yaf扩展的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。

延伸 · 阅读

精彩推荐