Installing Yaf
##This article assumes that you have installed the LNMP development environment (PHP version is not lower than 7.0) , start the description directly from installing the Yaf extensionBecause Yaf is a PHP framework developed in C language, it can also be understood as a PECL extension. Therefore, it is different from the frameworks developed with PHP that we usually encounter, such as ThinkPHP5. Laravel can be downloaded directly or installed and used through Composer. Yaf needs to install the extension before it can be used normally. First of all, let’s introduce how to install Yaf extension InstallationThe latest version of Yaf supports at least PHP7.0, so we need to ensure that the current PHP environment is version 7.0 or above. The highest version of Yaf that supports PHP5.X is 2.3.4. The author no longer recommends using the old version of Yaf. Since Yaf is famous for its high performance, and PHP7 is also famous for its high performance, why not let the two powerful forces join forces? 1. Compile and installCompile and install first need to download the source code through Git
First download the Yaf compilation and installation package and open (https://github.com/laruence/y...
$ > wget -c https://github.com/laruence/yaf/archive/yaf-3.0.5.tar.gz $ > tar xzvf yaf-3.0.5.tar.gz && cd yaf-3.0.5 $ > phpize $ > ./configure $ > make $ > sudo make install
Copy after login
php.ini file to load the
yaf.so file
php.ini file will be automatically configured. There is no need to manually load
yaf.so
$ > pecl install yaf
Copy after login
$ > php --ri yaf
Copy after login
$ > php --ri yaf yaf yaf support => enabled Version => 3.0.5 Supports => http://pecl.php.net/package/yaf Directive => Local Value => Master Value yaf.library => no value => no value yaf.action_prefer => Off => Off yaf.lowcase_path => Off => Off yaf.use_spl_autoload => Off => Off yaf.forward_limit => 5 => 5 yaf.name_suffix => On => On yaf.name_separator => no value => no value yaf.st_compatible => Off => Off yaf.environ => product => product yaf.use_namespace => Off => Off
Copy after login
$ > cd yaf-3.0.5/tools/cg/
Copy after login
$ > php yaf_cg Yaf_First
Copy after login
- Copy the generated code to the generation environment directory
$ > cp -r ./output/Yaf_First/* /home/wwwroot/default/
Copy after login
Welcome to my e-book "When Yaf Meets PHP7.1"