centos8 安装php8.0.7

40 篇文章 0 订阅
32 篇文章 0 订阅

yum install sqlite-devel oniguruma autoconf automake libtool libzip libzip-devel

unzip oniguruma-master.zip

cd oniguruma

./autogen.sh

./configure --prefix=/usr

make

make install

sudo tar zxvf libiconv-1.16.tar.gz

cd libiconv-1.16/

./configure --prefix=/usr/local

make

make install

重新弄即可

1、安装libmcrypt

tar zxvf libmcrypt-2.5.8.tar.gz #解压

cd libmcrypt-2.5.8 #进入安装目录

./configure #配置

make #编译

make install #安装

2、安装mhash

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make

make install

3、安装mcrypt

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

ln -s /usr/local/bin/libmcrypt_config /usr/bin/libmcrypt_config #添加软连接

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH #添加环境变量

./configure

make

make install

sudo tar zxvf php-8.0.7.tar.gz

cd php-8.0.7 (–with-mysql=mysqlnd 彻底不可用了,只能用pdo或者mysqli了)

./configure --prefix=/myweb/php --with-config-file-path=/myweb/php/etc --with-mysql-sock=/myweb/mysql/mysql.sock --with-mysqli=mysqlnd --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-openssl --with-mhash --enable-pcntl --enable-sockets --enable-soap --enable-ftp --with-pear --enable-exif --with-pdo-mysql=mysqlnd --with-apxs2=/myweb/apache/bin/apxs --enable-opcache --enable-gd --with-zip --with-zlib --with-iconv=/usr/local/bin/iconv

在安装一个软件包时,最后输入sudo make install命令后,出现以下错误信息:

error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

但是在/usr/local/lib下却能找到libiconv.so.2,解决方法是将/usr/local/lib路径添加到/etc/ld.so.conf文件中,然后用sudo ldconfig命令加载,再重新输入sudo make install命令就可以了。

include ld.so.conf.d/*.conf

/usr/local/lib

sudo make ZEND_EXTRA_LIBS=’-liconv’

19、sudo make install安装

20、复制php.ini进/myweb/php/etc/下

cp php.ini-production /myweb/php/etc/php.ini

设置/myweb/apache/conf/httpd.conf 找到libphp.so的设置位置 修改

LoadModule php_module modules/libphp.so

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

21、设置documentroot设置为/myweb/webroot

23、重启apache sudo apachectl restart

sudo ln -s /myweb/php/bin/php /usr/bin/php

sudo ln -s /myweb/php/bin/phpize /usr/bin/phpize

sudo ln -s /myweb/apache/bin/apachectl /usr/bin/apachectl

sudo ln -s /myweb/php/lib/php/extensions/no-debug-zts-20200930 myweb/php/ext/

extension_dir = ‘/myweb/php/lib/php/extensions/no-debug-zts-20200930’

24安装phpredis

yum install unzip

tar zxvf redis-5.3.4.tgz

cd redis-5.3.4

phpize

./configure -with-php-config=/myweb/php/bin/php-config

make && make install

curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssqlrelease.repo

即可查到相关的包的数据

yum install msodbcsql17 mssql-tools unixODBC-devel

tar zxvf pdo_sqlsrv-5.9.0.tgz

cd pdo_sqlsrv-5.9.0

phpize

./configure -with-php-config=/myweb/php/bin/php-config

make && make install

opcache已经被内置了,无需另外编译了

修改php.ini

extension_dir = ‘/myweb/php/lib/php/extensions/no-debug-zts-20200930’

date.timezone = PRC

[opcache]

zend_extension=opcache.so

opcache.enable=1

opcache.enable_cli=1

[redis]

extension=redis.so

[sqlsrv]

extension=pdo_sqlsrv.so

/myweb/php/bin/php -i |less 查看配置文件在哪里,编译参数

/myweb/php/bin/php -m |less 查看php加载的模块

nano /etc/crypto-policies/back-ends/opensslcnf.config

中,将MinProtocol=TLSv1.3改为

MinProtocol=TLSv1,然后重启服务器reboot即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lwprain

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值