PHP8 正式发布稳定版
song100e 发布于:2020-11-27 13:52 分类:PHP 有 445 人浏览,获得评论 0 条 标签: php8
2020 年 11 月 26 日, PHP正式发布稳定版 php8。一些新特性如Union Types (联合类型)、Named Arguments (命名参数)、Match Expressions (Match表达式)、Attributes (注解)、Constructor Property Promotion (构造函数属性提升)、Nullsafe Operator (Null安全操作符)、Weak Maps(弱映射)、Just In Time Compilation (JIT)。And much much more...
其中最核心的当属即时编译JIT了。
1,下载
https://www.php.net/distributions/php-8.0.0.tar.bz2 tar jxvf php-8.0.0.tar.bz2 cd php-8.0.0
2,配置:
./configure --prefix=/usr/local/php8 --enable-opcache --with-config-file-path=/usr/local/php8/etc --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-static --enable-sockets --with-zip --enable-calendar --enable-bcmath --enable-mbstring --with-zlib --with-iconv=/usr/local/libiconv --enable-gd --enable-mbstring --with-curl --with-freetype --with-mysql-sock=/tmp/mysql.sock --disable-ipv6 --disable-debug --with-openssl --enable-intl
3,解决问题
(1)No package 'oniguruma' found
yum install oniguruma-devel(2)No package 'libzip' found
yum remove libzip libzip-devel wget https://libzip.org/download/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install #装完了之后找一下/usr/local/lib下有没有pkgconfig目录,有的话执行命令 export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"指定PKG_CONFIG_PATH
3,安装
make && make install
4,安装出错:
报错 Killed signal terminated program cc1。
================腾讯云测试结果(实测)================= g++: fatal error: Killed signal terminated program cc1plus compilation terminated. make[2]: *** [sql/CMakeFiles/sql_gis.dir/gis/crosses.cc.o] Error 1 make[1]: *** [sql/CMakeFiles/sql_gis.dir/all] Error 2 make: *** [all] Error 2这是因为内存不足所致,可通过设置 2G 交换分区来解决该问题。
#获取要增加的2G的SWAP文件块 dd if=/dev/zero of=/swapfile bs=1k count=2048000 #创建SWAP文件 mkswap /swapfile #激活SWAP文件 swapon /swapfile #查看SWAP信息是否正确 swapon -s #添加到fstab文件中让系统引导时自动启动 echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab #swapfile文件的路径在/var/下,编译完后, 如果不想要交换分区了, 可以删除。删除交换分区: swapoff /swapfile rm -rf /swapfile

6, 完成安装。去示例页面
参考资料:
https://qq52o.me/2759.html
http://www.weitip.com/index.php/news/103.html
赞助我,共同学习进步!

