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

 

橙子主题打折出售

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

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

热门文章

WordPress 后台编辑器样式实现直接预览 在WordPress3.0以后,有一个新的实用功能:你可以更改默认后台编辑器(TinyMCE)的样...WordPress后台编辑器样式实现直接预览 作者:Pastore Antonio
1526 浏览量
【干货】Chrome插件(扩展)开发全攻略 写在前面我花了将近一个多月的时间断断续续写下这篇博文,并精心写下完整demo,写博客的辛苦大家懂的...【干货】Chrome插件(扩展)开发全攻略 作者:Pastore Antonio
1483 浏览量
memcached 处理 多端口:https://blog.csdn.net/Erica_1230/article/deta...memcached处理 作者:Pastore Antonio
1476 浏览量
使用Nginx+WordPress搭建个人网站 背景很多研究技术的朋友喜欢写博客。如果希望搭建一个完全属于自己的网站,也并不困难。这里简要分享一下...使用Nginx+WordPress搭建个人网站 作者:Pastore Antonio
1444 浏览量
wordpress学习五: 通过wordpress_xmlrpc的python包远程操作wordpress wordpress提供了丰富的xmlrpc接口api来供我们远程操控wp的内容。伟大的开源社区有人就...wordpress学习五:通过wordpress_xmlrpc的python包远程操作wordpress 作者:Pastore Antonio
1426 浏览量