Update php 7.0 to 7.4

Post Reply
sennevb
Posts: 11
Joined: Sat Nov 21, 2020 8:32 am

I'm trying to update my php 7.0 to version 7.4.

I used this code (found on the forum):

Code: Select all

apt -y install apt-transport-https ca-certificates
wget -nv -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list'
apt update
apt upgrade -y
apt -y install php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-common php7.4-opcache php7.4-readline
But i'm getting following errors:

Code: Select all

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.4-cli : Depends: libargon2-1 (>= 0~20171227) but it is not going to be installed
              Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
              Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.4-common : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
                 Breaks: php7.0-curl (< 7.0.33-1~) but 7.0.33-0+deb9u12 is to be installed
 php7.4-curl : Depends: libcurl4 (>= 7.56.1) but it is not installable
               Breaks: php7.0-curl (< 7.0.33-1~) but 7.0.33-0+deb9u12 is to be installed
 php7.4-fpm : Depends: libargon2-1 (>= 0~20171227) but it is not going to be installed
              Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
              Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.4-mbstring : Depends: libonig5 (>= 6.8.1) but it is not installable
 php7.4-memcache : Depends: libc6 (>= 2.25) but 2.24-11+deb9u4 is to be installed
 php7.4-memcached : Depends: libsasl2-2 (>= 2.1.27+dfsg) but 2.1.27~101-g0780600+dfsg-3+deb9u1 is to be installed
 php7.4-opcache : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
 php7.4-readline : Depends: libncurses6 (>= 6) but it is not installable
                   Depends: libtinfo6 (>= 6) but it is not installable
 php7.4-zip : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
How do i install the libargon, and libc6 dependencies?



Edit:
Did following and 7.4 is installed::

Code: Select all

sudo apt install apt-transport-https lsb-release ca-certificates curl -y
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
sudo apt install php7.4-curl php7.4-mbstring php7.4-bz2 php7.4-readline php7.4-intl  php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-curl php7.4-common php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mcrypt php7.4-mysql php7.4-opcache php7.4-pspell php7.4-readline php7.4-xml php7.4-zip
sudo apt install php7.4-bcmath php7.4-bz2 php7.4-curl php7.4-intl php7.4-mbstring php7.4-mysql php7.4-readline php7.4-xml php7.4-zip
How do i start using 7.4 now? just delete the old one, is this not going to break vestacp and webserver?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

do you have Apache installed?
if yes - then viewtopic.php?f=18&t=52
sennevb
Posts: 11
Joined: Sat Nov 21, 2020 8:32 am

I think i installed apache, but nginx is there as reverse proxy, how can i check this in control panel/terminal??

You linked to multi php, but i only want to install 7.4, you script is also working when i enable only 1 version?

Thanks for your fast response
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

sennevb wrote: Mon Jan 03, 2022 3:03 pm You linked to multi php, but i only want to install 7.4, you script is also working when i enable only 1 version?
Works.
Give it a try.

To see if you have Apache run:

Code: Select all

v-list-sys-services
sennevb
Posts: 11
Joined: Sat Nov 21, 2020 8:32 am

seems i killed something, went well, but apache is not starting:

systemctl status apache2.service:

Code: Select all

Jan 03 15:15:09 systemd[1]: Starting The Apache HTTP Server...
Jan 03 15:15:09 apachectl[13359]: AH00526: Syntax error on line 17 of /home/admin/conf/web/server.zelfbouw-domotica.be.apache2.conf:
Jan 03 15:15:09 apachectl[13359]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Jan 03 15:15:09 apachectl[13359]: Action 'start' failed.
Jan 03 15:15:09 apachectl[13359]: The Apache error log may have more information.
Jan 03 15:15:09 systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 03 15:15:09 systemd[1]: Failed to start The Apache HTTP Server.
Jan 03 15:15:09 systemd[1]: apache2.service: Unit entered failed state.
Jan 03 15:15:09 systemd[1]: apache2.service: Failed with result 'exit-code'.
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

try:

Code: Select all

apt install libapache2-mod-php7.4
a2enmod php7.4
This is something that I do not recommend to others, since you have a very specific situation here - somehow you had Apache in mpm_prefork mode - that is not default setup for myVesta - as well as php7.0.
sennevb
Posts: 11
Joined: Sat Nov 21, 2020 8:32 am

that seemed to fix it
thanks!!
Post Reply