centos 编译安装php8 php7升级php8
php7用yum安装的最好是删掉比较好,自己编译安装的可以不用删,但还是最好备份一下之前版本配置,还有版本切换的时间记得,扩展要同时更新。在centos7下编译安装php8
更新系统软件
yum update
[*]下载php8编译包
[*]安装依靠包
[*]编译配置
[*]安装
[*]修改环境变量
[*]修改php-fpm
[*]启动php-fpm
wget -O php8.tar.gz https://www.php.net/distributions/php-8.0.9.tar.gztar -xvf php8.tar.gzcd 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-opcachemake && make installvi /etc/profile/*在文件末尾增长下面两行*/PATH=$PATH:/usr/local/php/binexport PATH/*生效环境变量*/source /etc/profile建立软连接,可以直接利用PHP命令
页:
[1]