Install yaf Framework in CENTOS php 7.0 + nginx Environment
# php-vPHP 7.0.19 (cli) (built: May 12 2017 21:01:27) (NTS) Copyright (c) 1997-2017 The PHP GroupZend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies#nginx-vnginx version: nginx/1.12.0CentOS Linux release 7.2.1511 (Core)
The premise of this paper is that the php7.0+nginx environment has been set up.
1. First download the yaf source package, go to http://pecl.php.net/package/yaf, and download it. More than 3.0.2 requires php7.0 or above.
Let's download the source package of 3.0.4 stable version with the command.
Wgte http://pecl.php.net/get/yaf-3.0.4.tgz
2. Decompress
Tar-xvf yaf-3.0.4.tgz
3. Install the php-devel expansion package. Install php-devel required for 7. 0. The php version corresponding to the default yum install php-devel is 5. 3. 0. This is also a difference in 7.0.
Yum install php70w-devel
4. Enter the yaf installation directory
Phpize./coufiguremakemake install
There will be some problems, such as the lack of a C compiler, which can be searched and solved by yourself.
5. Configure php.ini. Add the following sentence to php.ini
Extension=yaf.so
6. Php-m to see if there is a yaf framework.
7. Restart php-fpm
Service php-fpm restart .
At this point, the yaf framework is installed.
Then we can use the code generation tool to generate a yaf demo.
Come to https://github.com/laruence/yaf to download the zip package and upload it to our server.
2. Enter the yaf directory tools/cg
3. Then / usr/local/php/bin/php yaf_cg sample. Sample is the name of the application we generated.
4. Put the sample folder in the root directory of the nginx website
/ data/www/sample
5. Visit locahost/sample
Appear
Hello World! I am Stranger
Success!
Referenc
Https://stackoverflow.com/questions/12325109/cant-install-php-devel-on-centos
Http://www.th7.cn/Program/php/201507/507424.shtml
Http://www.cnblogs.com/tomkissing/p/6250530.html
Http://www.cnblogs.com/findgor/p/4086502.html