Pada dasarnya secara default, laragon menggunakan php 7.2, tapi bagaimana kalau bre butuh versi php yang lain, mungkin 5.6 untuk kompatibilitas projek lama, atau versi terbaru karena minimum requirenment projek lebih tinggi dari versi laragon. Berbeda dengan xampp, konfigurasinya cukup to the point.

Kalau agan lihat, versi php saya ada dua, yang mana salah satunya merupakan custom yang saya tambahkan secara manual.

  1. Download php di sini php download

2. Pilih thread safe versi 64, pilih zip,

3. Lalu tinggal extract zip php di bin\php, untuk link download php : php download

C:\laragon2\bin\php
atau sederhananya buat bre sekalian, tinggal taruh [laragon-main folder]\bin\php

4. Lalu buka laragon di icon tray, lalu tinggal geser-geser saja sampai ke list php, tinggal klik php yang ingin dipilih, jangan lupa untuk reload apache

Bagaimana jika install php 8?

Untuk laragon, instalasi php 8, kita perlu pastikan kita telah stop dulu apache dan mysql, lalu download dan ekstrak php di bin\php

Kemudian ganti versi php ke versi 8 lalu start apache, Jika muncul error failed apache seperti ini,

Service Apache can not start. Reason:
httpd: Syntax error on line 546 of
C:/laragon2/bin/apache/httpd-2.4.35-win64-VC15/con…:
Syntax error on line 2 ofC:/laragon2/etc/apache2/mod_php. conf: Can't locate API module structure 'php8_module' in fileC:/laragon2/bin/php/php-8.0.8-Win32-vs16-x64/php8… No error

Maka kita perlu step tambahan,

Klik kanan icon laragon, lalu geser dari apache lalu klik dir: conf

Lalu akan muncul folder apache2, buka mod_php.conf

Berikut view dari mod_php, ganti LoadModule php8_module ” direktori” yang saya highlight

# This file is auto-generated, so please keep it intact.
LoadModule php8_module "C:/laragon2/bin/php/php-8.0.8-Win32-vs16-x64/php8apache2_4.dll"
PHPIniDir "C:/laragon2/bin/php/php-8.0.8-Win32-vs16-x64"
<IfModule mime_module>
    AddType application/x-httpd-php .php
</IfModule>

Ganti seperti ini, jadi LoadModule php_module

# This file is auto-generated, so please keep it intact.
LoadModule php_module "C:/laragon2/bin/php/php-8.0.8-Win32-vs16-x64/php8apache2_4.dll"
PHPIniDir "C:/laragon2/bin/php/php-8.0.8-Win32-vs16-x64"
<IfModule mime_module>
    AddType application/x-httpd-php .php
</IfModule>

Dari laragon tray icon, Geser ke Apache, lalu pilih start apache persis seperti langkah ke empat

Untuk cek versi php yang digunakan, pada main laragon gui, pilih terminal, ketik syntaks untuk cek versi php, yaitu dengan ketik php –version atau php -v

informasi versi php akan muncul dalam terminal, untuk mengetahui apakah server dapat berjalan menggunakan php yang digunakan, Jalankan saja apachenya, jika tidak muncul error berarti berhasil.

Sekian tutorial singkat untuk update mengganti versi php di laragon, semoga membantu. Wahaha

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.


Like it? Share with your friends!

What's Your Reaction?

Unfortunate
1
Unfortunate
Meh
1
Meh
Wahaha
2
Wahaha
Nin nin
1
Nin nin
nakomin

Believe at the heart of BNRS

Here you will find content about developers needs whether it’s coding tutorials or the lifestyle of employee in the IT circle, understanding of the realm of ui/ux and futuristic tech for free in one place. Don’t forget to follow the nakotek socials to give the author enthusiasm in pioneering this website. #wahahaforever

0 Comments

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