• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer

ATA ENDE

Catatan Orang Ende

  • Teknologi Informasi
    • IOT
    • Smart Home
    • Server
    • Mac OS
    • Android
  • Otomotif
    • BMW E36
  • DIY
  • Traveling
    • Ende
  • Olahraga
    • Running
  • Rohani
  • Lainnya
  • Privacy Policy
  • About
You are here: Home / Programming / Cara Upgrade Ke PHP7.4 pada OS Openhabian

Cara Upgrade Ke PHP7.4 pada OS Openhabian

December 16, 2020 by lorenz Leave a Comment

Secara default instalasi PHP pada sistem operasi Openhabian Raspberry Pi adalah PHP7.0. Apabila hendak mengupgrade versi ke PH7.3 atau PHP7.4 maka kita akan mendapatkan pesan error. Error ini disebabkan karena repository untuk PHP7.0 ke atas tidak terdaftar pada Openhabian. Untuk bisa mengupgrade versi PHP maka repositorynya harus diupgrade terlebih dahulu.

Berikut adalah cara untuk mengupgrade PHP ke versi PHP7.4 pada sistem operasi Openhabian Raspberry Pi. Pertama -tama adalah cek terlebih dahulu versi PHP7 yang ada saat ini:

#php -v
PHP 7.0.33-0+deb9u10 (cli) (built: Oct  6 2020 17:08:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-0+deb9u10, Copyright (c) 1999-2017, by Zend Technologies

Seperti yang terlihat di atas, versi saat ini yang terinstall adala versi 7.0.33. Jika kita langsung upgrade ke versi 7.4 misalnya, maka akan muncul pesan error

#sudo apt install php7.4
Reading package lists... Done
Building dependency tree        
Reading state information... Done
E: Unable to locate package php7.3
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'

Pesan error seperti di atas disebabkan karena Openhabian tidak bisa menemukan repository untuk php7.4. Untuk itu kita perlu menambahkan repository dengan terlebih dahulu menambahkan repository PGP key:

# wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease             
Get:3 https://packages.sury.org/php stretch InRelease [6,772 B]
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://repos.influxdata.com/debian buster InRelease
Hit:6 https://packages.grafana.com/oss/deb stable InRelease
Get:7 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Hit:7 https://dl.bintray.com/openhab/apt-repo2 stable Release
Get:8 https://packages.sury.org/php stretch/main armhf Packages [270 kB]
Fetched 302 kB in 3s (80.8 kB/s)                             
Reading package lists... Done

Setelah itu tambahkan repository PHP

# echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php7.list

Lalu update index repository

# sudo apt-get update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease             
Get:3 https://packages.sury.org/php stretch InRelease [6,772 B]
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://repos.influxdata.com/debian buster InRelease
Hit:6 https://packages.grafana.com/oss/deb stable InRelease
Get:7 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Hit:7 https://dl.bintray.com/openhab/apt-repo2 stable Release
Get:8 https://packages.sury.org/php stretch/main armhf Packages [270 kB]
Fetched 302 kB in 3s (80.8 kB/s)                             
Reading package lists... Done

Kemudian install PHP7.4

#sudo apt install php7.4
Get:1 https://packages.sury.org/php stretch/main armhf php7.4-common armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [589 kB]
Get:2 https://packages.sury.org/php stretch/main armhf php7.4-json armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [16.5 kB]
Get:3 https://packages.sury.org/php stretch/main armhf php7.4-opcache armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [170 kB]
Get:4 https://packages.sury.org/php stretch/main armhf php7.4-readline armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [10.8 kB]
Get:5 https://packages.sury.org/php stretch/main armhf php7.4-cli armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [1,187 kB]
Get:6 https://packages.sury.org/php stretch/main armhf libapache2-mod-php7.4 armhf 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [1,139 kB]
Get:7 https://packages.sury.org/php stretch/main armhf php7.4 all 7.4.13-1+0~20201130.33+debian9~1.gbpd59941 [43.4 kB] 
...
...
Creating config file /etc/php/7.4/cli/php.ini with new version
Setting up libapache2-mod-php7.4 (7.4.13-1+0~20201130.33+debian9~1.gbpd59941) ...

Creating config file /etc/php/7.4/apache2/php.ini with new version
libapache2-mod-php7.4: php7.0 module already enabled, not enabling PHP 7.4
Setting up php7.4 (7.4.13-1+0~20201130.33+debian9~1.gbpd59941) ...
Processing triggers for php7.4-cli (7.4.13-1+0~20201130.33+debian9~1.gbpd59941) ...
Processing triggers for libapache2-mod-php7.4 (7.4.13-1+0~20201130.33+debian9~1.gbpd59941) ...
Updating FireMotD available updates count ... 2020-12-16 16:38:06,999: FireMotD: Error: Template folder doesn't exist. Upgrading from an older version? Please run make again or run the install function "FireMotD -I -v".

Setelah sukses, cek versi PHP yang sudah terinstall

#php -v
PHP 7.4.13 (cli) (built: Nov 30 2020 20:40:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies

Dan jika kita menggunakan Apache, jangan lupa untuk menonaktifkan modul PHP7.0 dan mengaktifkan modul PHP7.4 unutuk apache

#sudo a2dismod php7.0
#sudo a2enmod php7.4

Selamat mencoba.

Related posts:

  1. Membangun Server Home Automation dengan Openhab dan Raspberry Pi
  2. Mengamankan Apache dengan SSL Gratis Lets Encrypt
  3. Memahami Konsep Home Automation Openhab
  4. [DIY] Aplikasi Water Flow Sensor dan Arduino pada Toren Air

Filed Under: Programming, Smart Home Tagged With: openhabian, php7.4, raspberry, smarthome, ubuntu

About lorenz

A husband, father, passionate software developer, diy lover, home baker, who loves to learn and create new things.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Primary Sidebar

About Me

A husband, father, passionate software developer, diy lover, home baker, who loves to learn and create new things. Read More…

Ende

Bukit Roja Ende Flores

Kembali lagi Ke Bukit Roja (Jilid 2)

May 3, 2021 By lorenz 1 Comment

Bukit Kezimara Ende

Bukit Kezimara, Spot Paralayang Instagramable di Kota Ende

April 29, 2021 By lorenz Leave a Comment

Bukit Woloweku Ende

Bukit Woloweku, Spot Foto Instagramable di Kota Ende

April 26, 2021 By lorenz Leave a Comment

More Posts from this Category

Smart Home

Ip camera hikvision

Cara Online IP Camera CCTV Hikvision

July 28, 2021 By lorenz Leave a Comment

Sonoff Slampher

Cara Menggunakan Sonoff Slampher (Fitting Lampu Otomatis)

July 19, 2021 By lorenz Leave a Comment

Hik-connect

Cara Online CCTV Hikvision dengan Hik-Connect

February 1, 2021 By lorenz Leave a Comment

More Posts from this Category

Tags

ads scanner android arduino berkat rumah bmw bmw e36 bmw m50 bukit roja cctv cooling system electrolux Error 1302 fan belt ffmpeg heart rate hik-connect hikvision home automation Huawei HG8245H5 ibadat pemberkatan rumah Indihome iot ip camera kipas radiator kota ende LAN Port lari m50 mesin cuci openhab raspberrypi running s20 smart home smarthome smart plug sonoff tasmota Telkom tensioner toren air tracking ubuntu USeeTV visco fan

My Strava

Footer

Recent Comments

  • lorenz on Mengatasi BMW E36 Tidak Bisa Distart
  • sar on [DIY] Membuat Sendiri Sensor Level Ketinggian Air Toren dengan Arduino
  • Eriq on Mengatasi BMW E36 Tidak Bisa Distart
  • lorenz on [DIY] Membuat Sendiri Sensor Level Ketinggian Air Toren dengan Arduino
  • lorenz on Diagram Elektrikal Lampu Belakang BMW E36

Galery

Bukit Roja Ende
Bukit Roja Ende
Woloweku Ende
Woloweku Ende
Bukit Kezimara Ende
Bukit Kezimara Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende

Social

  • Facebook
  • Instagram
  • Twitter
  • YouTube

Copyright © 2025 · Ataende.com