Cara downgrade php 8 ke 7

Cara downgrade php 8 ke 7

With the arrival of PHP 8.0, you will no doubt have a web server along the way get upgraded to the latest version and break one of the sites it’s hosting. Since you are reading this I am going to assume this has happened to you. If so don’t worry in just a few minutes we should be able to have you back on PHP 7.4

First, you will need to log in to the console of the server. Use your favorite remote tool or ssh client to do that. Now that we are in we will need to Enable PPA for PHP 7.4 in your system and install it. To do that we will issue the following commands.

Update; sometimes we learn new ways to do things and need to make updates so I just found an easier way to accomplish this task so I will list both below.

Use update-alternatives –config php

The first way to accomplish this is by issuing the following command

sudo update-alternatives --config php

This will give you a listing as shown below

sudo update-alternatives --config php
There are 2 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/php8.0   80        auto mode
  1            /usr/bin/php7.4   74        manual mode
  2            /usr/bin/php8.0   80        manual mode

Press  to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in manual mode

As you can see I entered the number 1 to select version 7.4. Then did a quick check to validate the change.

php -v
PHP 7.4.25 (cli) (built: Oct 22 2021 12:33:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.25, Copyright (c), by Zend Technologies

Let’s restart apache2 s our changes will take effect.

sudo systemctl restart apache2

Use a2enmod to enable 7.4

First, add the repo and update apt.

sudo add-apt-repository ppa:ondrej/phpsudo
apt-get update

Then we will install PHP 7.4 and the extension needed. Depending on your setup you may not need all the extensions listed.

sudo apt-get installphp7.4sudoapt-get installphp7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring  php7.4-zip php7.4-fpm php7.4-intl php7.4-simplexml

Then we will disable the PHP 8.0 module by removing those symlinks. Then enable PHP 7.4 by using a2enmod.

sudo a2dismod php8.0
sudo a2enmod php7.4

Let’s restart apache2 s our changes will take effect.

sudo systemctl restart apache2

Now to set an alternative name path we will use these commands

sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4

I hope you find this helpful!

Cara downgrade php 8 ke 7

Salam Jumpa kembali Sobat Oprek Bareng Dan Subscriber Chanel Kaum Rebahan Oprek Bareng sudah lama sekali saya tidak menulis artikel di blogger pribadi saya ini, di karenakan banyaknya aktivitas dunia nyata, hehehee......

Kali ini saya akan membagikan bagaimana cara mendowngrade versi php 8 ke php 7 di aplikasi termuk, karena banyak sekali yang mencari tentang Cara Downgrade PHP 8 Ke PHP 7 di Termuxseperti yang ada di chanel youtube saya Kaum Rebahan Oprek Bareng  yang sudah tidak work, dengan keterangan "CANNOT LINK EXECUTABLE "php": library "libicuio.so.67" not found". sekalian promosi ya membangun channel saya, jangan lupa subrek, like, dan Commentnya dan jangan lupa share artikel ini.

Ada 2 versi system pada android yang sudah kita kenal dengan versi ARM dan AARCH, nah salah satunya yang akan kita bahas di sini adalah Cara Downgrade PHP 8 Ke PHP 7 di Termux ARM yang bisa kita sebut dengan system android yang hanya support dengan versi 32 bit kalau yang versi AARCH bisa di sebut juga dengan versi 64 bit.

Langkah langkah downgrade PHP 8 Ke PHP 7 di Termux ARM

1. Silahkan buka termux terlebih dahulu dan ketikkan php -v untuk mengecek versi php Sobat Oprek Bareng

2. Silahkan ketik uname -m untuk melihat versi device arm atau aarch

3. Silahkan download file berikut ini untuk melakukan downgrade phpnya:

4. Silahkan simpan file downgrade ke folder penyimpanan internal tepatnya di folder download

5. Silahkan exstrack file zip tersebut hingga selesai

6. Kemudian akses file tersebut melalui termux dengan perintah cd /sdcard/download/nama-folder

7. nama-folder artinya adalah dimana Sobat Oprek Bareng Menyimpan Script Downgrade di folder Download

8. Kemudian ketik ls untuk melihat apakah file tersebut ada di dalam folder tersebut

9. Kemudian eksekusi file php7.sh dengan perintah php php7.sh tunggu hingga proses installasi atau downgrade php selesai

10. Silahkan cek kembali dengan cara php -v jika muncul php 7.4.12 bla bla bla maka installasi sukses.

Apabila terjadi kesalahan dalam downgrade silahkan tinggalkan komentar dan jangan lupa follow blogger Oprek Bareng untuk mendapatkan update terbaru. next time update Cara Downgrade PHP 8 Ke PHP 7 di Termux AARCH

Jangan Lupa Follow, Share Post, dan Komentar Yang Membangun Bagi Penulis agar Bisa Lebih Berkarya, Salam Bloger Indonesia.