• 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
  • Android
  • Otomotif
    • BMW E36
  • DIY
  • Olahraga
    • Running
  • Rohani
  • 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

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

About Me

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

Categories

  • Android
  • BMW E36
  • DIY
  • Featured Articles
  • IOT
  • IT
  • Olahraga
  • Otomotif
  • Programming
  • Rohani
  • Running
  • Smart Home

Featured Posts

DIY Mengganti Water Pump BMW E36

Pengalaman Overhaul Cooling System BMW E36

Memperbaiki Washer Pump BMW E36

Membangun Server Home Automation dengan Openhab dan Raspberry Pi

Review Sepatu Lari New Balance 880V9




Footer

Recent Comments

  • best cannabidiol gummies on Cara Pasang Selang Inlet Mesin Cuci Electrolux
  • lorenz on Cara Mengatasi Error Code 1302 pada UseeTV Indihome
  • boris on Cara Mengatasi Error Code 1302 pada UseeTV Indihome
  • lorenz on Cara Mengatasi Error Code 1302 pada UseeTV Indihome
  • Gintan on Cara Mengatasi Error Code 1302 pada UseeTV Indihome

Social

  • Facebook
  • Instagram
  • Twitter
  • YouTube

Tags

ads scanner android arduino ate berkat rumah bmw bmw e36 bmw m50 break pad cctv cooling system electrolux Error 1302 fan belt ffmpeg heart rate hikvision home automation Huawei HG8245H5 ibadat pemberkatan rumah Indihome iot ip camera kampas rem kipas radiator LAN Port lari m50 mesin cuci openhab raspberrypi running s20 sensor rem smart home smarthome smart plug sonoff tasmota Telkom tensioner toren air ubuntu USeeTV visco fan

Copyright © 2021 · Ataende.com