Install dan konfigurasi Scripting Language PHP di Red Hat Enterprise Linux (RHEL)

 



Scripting Language PHP

📌 Pendahuluan

PHP adalah bahasa scripting server-side, open source yang populer digunakan untuk pengembangan web. PHP (Hypertext Preprocessor) digunakan untuk menghasilkan konten dinamis di halaman web dan sering dikombinasikan dengan HTML, CSS, dan JavaScript.

Persiapan Sebelum Instalasi

✔️ Pastikan sistem RHEL kamu sudah up to date:

sudo dnf update -y

✔️ Pastikan sudah login sebagai user dengan akses sudo.

✔️ Pastikan sudah memiliki akses internet

 

Langkah Langkah :

1.     Aktifkan repositori AppStream (kalau belum aktif)

PHP biasanya tersedia di repositori AppStream RHEL.

sudo dnf module list php

Perintah ini akan menampilkan daftar versi PHP yang tersedia. Contoh output:



2.     Pilih dan aktifkan versi PHP yang diinginkan

Misalnya mau pakai PHP 8.0:

sudo dnf module reset php

sudo dnf module enable php:8.0

tunggu proses

3.      Install PHP dan beberapa modul umum + Ekstensi untuk WordPress & Moodle

sudo dnf install -y php php-cli php-fpm php-mysqlnd php-opcache php-xml \

php-gd php-curl php-mbstring php-json php-zip php-soap php-intl php-sodium

4.     Cek versi PHP

php -v


(Opsional) Uji PHP dengan Web Server

·       buat file uji coba di /var/www/html/:

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

Akses melalui browser: http://<ip_server>/info.php




 

 

 






Komentar

Postingan populer dari blog ini

Installasi/Konfigurasi Server DNS Red Hat Enterprise Linux (RHEL)

Installasi Web Server di Red Hat Enterprise Linux (RHEL)

install dan konfigurasi LMS (moodle) di Red Hat Enterprise Linux (RHEL)