Heim  >  Artikel  >  Backend-Entwicklung  >  ubuntu下安装yaf框架

ubuntu下安装yaf框架

WBOY
WBOYOriginal
2016-08-08 09:19:001309Durchsuche

参考
http://yaf.laruence.com/manual/yaf.install.html
首先要找到php的安装目录,执行info.php,查看php路径

Configuration File (php.ini) Path 	/etc/php5/apache2 

再查找phpize的地址在哪里,
whereis phpize

然后cd 到yaf的解压缩目录,执行
     
/usr/bin/phpize

如果不是在yaf的解压缩目录下,没.m4文件,会报错
Cannot find config.m4.

  Make sure that you run /usr/local/bin/phpize in the top level source directory of the module

再执行
    
 ./configure --with-php-c/bin/php-config

要注意,必须先安装pcre。如果没有会报错
pcre.h: No such file or directory

安装 pcre
sudo apt-get install libpcre3-dev

再执行
make

    
最后执行,如果不加sudo,可能有权限问题。因为要创建folder
sudo make install

最后提示:
Installing shared extensions:     /usr/lib/php5/20121212/
然后在php.ini中载入yaf.so, 重启PHP.
vi /ext/php5/apache2/php.ini

vi后可直接‘/extension_dir '查找,找到后可能是这样的:
extension_dir  = "./"
需修改成:
extension_dir  = "/usr/lib/php5/20121212/"   (注意是so文件的所在)
extension=yaf.so
最后保存退出! :wq!
重启
service apache2 restart
或者
sudo /etc/init.d/apache2 restart

重启后,再打开info.php 会看到
yaf support	Yaf logo enabled
Version 	2.3.3
Supports 	http://pecl.php.net/package/yaf 

以上就介绍了ubuntu下安装yaf框架,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn