将Yaf框架编译进PHP

Yaf is the first PHP MVC framework which is written in C and build as PHP extension.

官方网站:http://www.yafdev.com

最近项目需要用到该框架。关于Yaf的配置我在此记录一下,方便以后查阅。

1.可通过官网链接下载源码。

 解压缩以后, 进入Yaf的源码目录, 依次执行(其中$PHP_BIN是PHP的bin目录):

 

$PHP_BIN/phpize
./configure --with-php-config=$PHP_BIN/php-config
make
make install

编译后,在php.ini文件中加入扩展

extension=yaf.so

并重启服务器即可。

在Mac OSX 10.8中的编译:

解包并进入文件夹后:

phpize
./configure --with-php-config=php-config
make
make install

编译后同样在php.ini中加入扩展即可。

但有一点需要注意,Mac OSX需要安装Xcode及其开发扩展来支持编译环境。

 

参考文献:

http://yaf.laruence.com/manual/yaf.install.html#yaf.installation.linux

https://github.com/laruence/php-yaf#yaf---yet-another-framework

涉及到的知识:

用 phpize 编译共享 PECL 扩展库:http://www.php.net/manual/zh/install.pecl.phpize.php

php-config:http://www.php.net/manual/zh/install.pecl.php-config.php

posted @ 2013-07-10 01:46  huangpu  阅读(649)  评论(0编辑  收藏  举报