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错误解决方法

 

橙子主题打折出售

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

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

热门文章

西游记之大圣归来 《西游记之大圣归来》是根据中国传统神话故事《西游记》进行拓展和演绎的3D动画电影。由横店影视、天空之城、燕城十月与微影时代作为出品方,高路动画、恭梓兄弟、世纪长龙、山东影视、东台龙行盛世、淮安西游产业与永康壹禾作为联合出品方出品,田晓鹏执导,张磊、林子杰、刘九容和童自荣等联袂配音。影片讲述了已于五行山下寂寞沉潜五百年的孙悟空被儿时的唐僧——俗名江流儿的小和尚误打误撞地解除了封印,在相互陪伴的冒险之旅中找回初心,完成自我救赎的故事。 作者:Pastore Antonio
1448 浏览量
常用的Centos操作Shell命令 玩WordPress的时候经常会接触到一些常用的命令,老是忘记……人年纪大了就是不给力啊。浏览量:...常用的Centos操作Shell命令 作者:Pastore Antonio
1387 浏览量
ffmpeg+srs 实现直播流 这篇文章是我在做直播流的时候收集的所有素材,没有太多的整理,都放到了脑袋里面了,之后有时间了再整理成...ffmpeg+srs实现直播流 作者:Pastore Antonio
1386 浏览量
项目十大管理和五大过程 PMBOK五大过程组是什么?PMBOK五大过程组是:启动过程、规划过程、执行过程、监...项目十大管理和五大过程 作者:Pastore Antonio
1363 浏览量
[ Office 365 开发系列 ] 身份认证 前言本文完全原创,转载请说明出处,希望对大家有用。通常我们在开发一个应用时,需要考虑用户身份认证...[Office365开发系列]身份认证 作者:Pastore Antonio
1357 浏览量