Linux安装yaf-3.0.X
安装yaf
tips:如果想用yaf-3.0的版本,请先安装php7,php5.6的只能用yaf-2.3.5
(据说只有3.0.5版本兼容php7.2)
1、下载
sudo wget https://github.com/laruence/yaf/archive/yaf-3.0.5.tar.gz
2、解压
sudo tar -zvxf yaf-3.0.5.tar.gz
3、进入
cd yaf-yaf-3.0.5/
4、phpize
sudo /usr/local/php7.2/bin/phpize
5、编译
sudo ./configure --with-php-config=/usr/local/php7.2/bin/php-config
6、安装
sudo make && sudo make install
7、开启shell_exec,proc_get_status,proc_open
sudo vim /usr/local/php7.2/etc/php.ini
8、增加ini配置
extension = "yaf.so"
9、重启lnmp
# sudo lnmp restart
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx... done
[ ok ] Stopping mysql (via systemctl): mysql.service.
Gracefully shutting down php-fpm . done
Gracefully shutting down php-fpm . done
Starting LNMP...
Starting nginx... done
[ ok ] Starting mysql (via systemctl): mysql.service.
Starting php-fpm done
Starting php-fpm done
10、查看模块
# /usr/local/php7.2/bin/php -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaf
zlib
[Zend Modules]
我们发现里面已经有了yaf
nginx配置:
server {
listen 443 ssl;
server_name www.xx.com;
root "/home/www/xx/public";
ssl_certificate /usr/local/nginx/ssl/www.xx.com.pem;
ssl_certificate_key /usr/local/nginx/ssl/www.xx.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
index index.php index.html index.htm;
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?$1 last;
break;
}
}
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$
{
expires 12h;
access_log off;
}
access_log /home/wwwlogs/cs.log;
}
server {
listen 80;
server_name www.xx.com;
rewrite ^(.*)$ https://$host:443$1 permanent;
}