今天对 VPS 做了一些改动。就是安装了最新版本的 Nginx,Nginx v1.19.7。
davidyin@daisy:~$ nginx -V
nginx version: nginx/1.19.7
built with OpenSSL 1.1.1j 16 Feb 2021
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-qK5Rf9/nginx-1.19.7=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module
在安装了 php 7.4.x 的同时也安装了 php 8.0.x,当前最新的版本是 v8.0.3
davidyin@daisy:~$ php -v
PHP 8.0.3 (cli) (built: Mar 5 2021 07:54:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
在里面可以查看 Brotli 的压缩方式也启用了。
davidyin@daisy:~$ brotli -V
brotli 1.0.9
为什么要使用 php 8.0?
这还用说么?大势所趋,JIT 都已经有了,更快更高更强啊。
安装是用的 ppa:ondrej 的 PHP 库。
这里我要特别的记录一下,我启用 php8.0 的时候如何设置的 JIT。默认安装 php8.0 并不会自动启用 JIT,反而是关闭的。