Logo

linux 安装php8

photo

2021年12月11日

准备工作

  创建空文件夹

> mkdir /opt/php //创建目录
> cd /opt/php //进入目录

  安装php运行依赖库

> yum install openssl-devel gcc gcc-c++ wget make libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel 
   bison autoconf sqlite-devel bzip2-devel libcurl-devel libicu-devel libxslt-devel libzip-devel libtidy-devel libtidy
> yum --enablerepo=PowerTools install oniguruma-devel

 

下载源码

> wget https://www.php.net/distributions/php-8.0.6.tar.gz //下载php8
> tar vxf php-8.0.6.tar.gz //解压php压缩
> mv php-8.0.6 php8 //改名

  配置准备

> mkdir /opt/php/php //建立php安装目录
> mkdir /opt/php/etc //建立php配置目录

配置php

> ./configure --prefix=/opt/php/php/ --with-config-file-path=/opt/php/etc  --enable-fpm --enable-mysqlnd --enable-opcache --enable-pcntl --enable-mbstring --enable-soap --enable-zip --enable-calendar  --enable-bcmath 
  --enable-exif --enable-ftp --enable-intl --with-mysqli --with-pdo-mysql --with-openssl --with-curl --with-gd --with-gettext --with-mhash --with-openssl --with-mcrypt --with-tidy --enable-wddx --with-xmlrpc --with-zlib

  配置成功会出现以下信息  

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+
 
Thank you for using PHP.

编译&安装

> make 
> make install

判断是否安转成功

 

> cd /opt/php/php/bin //进入php的安装目录下的bin
> ./php --version //查看版本号

 

  出现版本号,则安装成功

 

可能出现的问题

  在配置过程中,出现的问题基本上都是某个依赖包没有安装好,这几篇文章能给你一些帮助。

  php8在centos7安装

  error: C++ preprocessor “/lib/cpp” fails sanity check错误解决方法

 

橙子主题打折出售

其实我不卖,主要是这里是放广告的,所以就放了一个
毕竟主题都没做完,卖了也是坑.

购买它
本文为原创文章,请注意保留出处!

热门文章

修复群晖Synology Drive client右键菜单缺失问题 本教程主要解决windows10右键菜单中没有SynologyDrive菜单的问题,整体思路是找到...修复群晖SynologyDriveclient右键菜单缺失问题 作者:Pastore Antonio
2005 浏览量
docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 前言:有时候我们会在docker上下载一个镜像,或者是上传一个镜像到docker上,甚至有时候就是在...docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 作者:Pastore Antonio
1944 浏览量
Adobe Acrobat Pro 激活 这里记录了一些AdobeAcrobat的激活教程和组件。浏览量:1,825 作者:Pastore Antonio
1668 浏览量
追寻日出,找回自己 为什么我要去追寻日出?其实我是一个很懒的人,每次都起不来,直到有一次我在租房中睡到了大天亮,阳光照...追寻日出,找回自己 作者:Pastore Antonio
1625 浏览量
Swagger2 接口多级分组方法 swagger无疑是Java开发的最佳伴侣,接口非常方便调试;当然也有用Postman,因人而异吧...Swagger2接口多级分组方法 作者:Pastore Antonio
1532 浏览量