您的位置 首页 php

centos 编译安装php8 php7升级php8

php7用yum安装的最好是删掉比较好,自己编译安装的可以不用删,但还是最好备份一下之前版本配置,还有版本切换的时候记得,扩展要同时更新。

在centos7下编译安装php8

更新系统软件

 yum update  
  1. 下载php8编译包
  2. 安装依赖包
  3. 编译配置
  4. 安装
  5. 修改环境变量
  6. 修改php-fpm
  7. 启动php-fpm
 wget -O php8.tar.gz 
tar -xvf php8.tar.gz
cd php-8.0.9
./configure --prefix=/usr/local/php --with-config-file-path=etc --enable-fpm   --with-fpm-user=nginx --with-fpm-group=nginx --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear --enable-opcache
make 
&& make install
vi /etc/profile/*在文件末尾增加下面两行*/PATH=$PATH:/usr/local/php/binexport PATH/*生效环境变量*/source /etc/profile  

建立软连接,可以直接使用PHP命令

文章来源:智云一二三科技

文章标题:centos 编译安装php8 php7升级php8

文章地址:https://www.zhihuclub.com/78424.shtml

关于作者: 智云科技

热门文章

网站地图