当前位置:网站首页>Tongxin UOS uninstall php7 2.24, install php7 4.27 ; Uninstall and then install PHP 7.2.34

Tongxin UOS uninstall php7 2.24, install php7 4.27 ; Uninstall and then install PHP 7.2.34

2022-04-23 14:18:00 Nightwish5

Background

 Tongxin UOS(arm64) 、  Due to missing scanning , Last installation php7.2.24 It doesn't meet the requirements , Now upgrade it to php7.4.27
 This article records some resources from websites 、 Pit encountered and treatment method .
 The system shall take a snapshot before modification 

The resources in this article come from the website :

php7.4 arm64 deb package : http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.4/
php7.2 arm64 deb package : http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.2/

 Jincang and PHP Driver interface file :https://www.kingbase.com.cn/index/download/c_id/401.htm

 install PHP Required dependency packages :
php-common Of deb package : http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php-defaults/
libpcre2 Of deb package : http://ftp.de.debian.org/debian/pool/main/p/pcre2/libpcre2-8-0_10.39-3_arm64.deb
libonig4 Of deb package :http://ports.ubuntu.com/pool/universe/libo/libonig/libonig4_6.7.0-1_arm64.deb
libpcre3 Of deb package :https://packages.sury.org/php/pool/main/p/pcre3/

 Insert picture description here

One 、 uninstall php7.2

# View installed php , Then copy, paste and uninstall .  It's best to do it several times .
 apt-cache search php7.2  | awk '{print $1}' | xargs -i echo "apt-get remove --purge {}"

Question 1 apt-get remove Report errors

uninstall apt-get remove --purge php7.2-fpm appear E: There are unsatisfied dependencies .i Please try to run... Without referring to the package name .
answer : Use apt --fix-broken install To repair
 Insert picture description here

Question two dpkg Dependency problem during installation php-common 1:81

According to the information in the figure , When installed php7-4-common When , He needs to rely on php-common >=1.81 Version of , And there are... In the system php-common 1:60ubuntu1 Version of .
 Insert picture description here
answer : In order to meet his requirements , To uninstall this php-common 1:60ubuntu1, Install one he asked php-common edition .

dpkg -l | grep php   To query the installed php edition  .  Continue to uninstall !

apt-get remove --purge -y php-common
apt-get remove --purge -y libapache2-mod-php7.3
apt-get remove --purge -y php7.3-cli
apt-get remove --purge -y php7.3-common
apt-get remove --purge -y php7.3-json
apt-get remove --purge -y php7.3-opcache
apt-get remove --purge -y php7.3-readline

dpkg -i php-common_92+ubuntu18.04.1+deb.sury.org+2_all.deb

 Insert picture description here

Question 3 install php7.4-cli Need to rely on libpcre2-8-0 (>= 10.38)

 Insert picture description here
** answer :** Download and install :libpcre2-8-0_10.39-3_arm64.deb

Question 4 install php7.4-mbstring Need to rely on libonig4 (>= 5.9.5)

 Insert picture description here
** answer :** Download and install libonig4_6.7.0-1_arm64.deb

Summary : The above questions are based on the tips , Find the corresponding dependency package from the Internet , The dependency problem can be solved after downloading and installing .

Question five /lib/aarch64-linux-gnu/libcrypto.so.1.1:version ‘OPENSSL_1.0.0’ no found

( Be careful ) Don't easily replace /lib/aarch64-linux-gnu/ perhaps /lib/x86_x64-linux-gnu Under the so file !!!

 Insert picture description here
This PHP7.4 Docking configuration with gold warehouse , The problem is x86 framework The situation can be handled according to the blog :https://zhuanlan.zhihu.com/p/410412408 《 Can't find libssl.so.10 The ultimate solution – Ubuntu 18》

 To put it simply, compile OpenSSL, Then copy and paste the compiled file libssl.so.1.0.0 and libcrypto.so.1.0.0 To /lib/x86_64-linux-gnu, Then create soft links .

 Download the old version OpenSSL

wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1e.tar.gz
tar -zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config shared zlib-dynamic
make
#  In this step, it will appear that you can't find zlib.h Single moth . If something like this happens , Please first sudo apt-get install libz-dev
#  Not surprisingly, it should appear in the directory at this time libssl.so.1.0.0 and libcrypto.so.1.0.0
cp libssl.so.1.0.0 libcrypto.so.1.0.0 /lib/x86_64-linux-gnu
cd /lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 libssl.so.10
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10

 Insert picture description here
But in arm64(aarch64) If you use this method on ,cp Of the rear system ssh The service just hung up
( adopt VNC Connect , Unload and reload openssl 、openssh Not good either. , Recovery method unknown , Not found out .)

 but aarch64 Architecturally   Please use with caution .  Maybe the compilation method is wrong 
https://www.cnblogs.com/wen123456/p/14046666.html  《openssl Migration to aarch64 Linux》
cp   libssl.so.1.0.0 libcrypto.so.1.0.0   /lib/aarch64-linux-gnu

 Insert picture description here

since php7.4 Yes , Looking for deb In the process of packaging , Also found php7.2.34 deb . Then change to php7.2.34 Well ~

Question 6 Installation depends on libpcre3 (>= 2:8.41)

 Insert picture description here

 Try it first  , Update to see if the version will be higher 
apt-get update
apt show libpcre3
apt-get install libpcre3

 visit  https://packages.sury.org/php/pool/main/p/pcre3/    ,  Web page view source code    You can see the full name .
 install  libpcre3_8.41-1+0_20181207195800.1+stretch_1.gbp97d153_arm64.deb

Reference source :https://stackoverflow.com/questions/61787420/closed-error-on-apt-get-update-sury-org-linux

Summary : Through this missed scanning , It's a preliminary understanding of installation / uninstall deb package , Learn to find out the source of dependent packages ....

版权声明
本文为[Nightwish5]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231408132388.html