Ubuntu20.04 安装Yaf 3.2.3

2020-05-25  本文已影响0人  雨醉风尘

环境情况

Ubuntu 20.04

PHP7.3.5

Nginx/1.18.0


1:安装Yaf 扩展
   // extension_dir 可以通过phpinfo()  中获取
   extension_dir = "/home/dd/lnmp/php/lib/php/extensions/no-debug-non-zts-20180731/"
   extension=yaf.so
11.png
2:生成Yaf 基础框架代码

cd yaf-master/tools/cg

php yaf_cg -a yaf-awesome -d /home/dd/lnmp/www/yaf-awesome

root@path# php yaf_cg  -a yaf-awesome -d /home/dd/lnmp/www/yaf-awesome
Outputing Yaf Skeleton to /home/dd/lnmp/www/yaf-awesome
Generating done
12.png
 server {
        listen       8081;                 # 监听端口
        server_name  localhost;          # 站点域名
        root         /home/dd/lnmp/www/yaf-awesome;               # 站点根目录
        index index.html index.htm index.php;  # 默认导航页
     
        location / {
            index index.html index.htm index.php;
            if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename){
                rewrite (.*) /index.php;
            }
         
        }
        # PHP配置
        location ~ \.php$ {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include       fastcgi_params;
            access_log    /home/dd/lnmp/logs/nginx/access.8080.log;
            error_log     /home/dd/lnmp/logs/nginx/error.8080.log;
        }
    }
13.png

安装过程中报错及解决方案

1:php编译扩展库时报错:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

apt-get install m4

apt-get -y install autoconf

上一篇 下一篇

猜你喜欢

热点阅读