> For the complete documentation index, see [llms.txt](https://learn.devlabss.my.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.devlabss.my.id/php/bab-1-persiapan-awal/praktik-setup-localhost-and-uji-coba-file.md).

# Praktik: Setup Localhost & Uji Coba File

Praktik ini menggabungkan seluruh materi Bab 1 dalam satu alur kerja sederhana.

Di sini Anda menyiapkan server lokal, membuat file, lalu memastikan hasilnya tampil di browser.

### Target praktik

Setelah praktik ini selesai, Anda seharusnya bisa:

* menyalakan localhost
* membuat file PHP
* menampilkan output di browser

### Langkah praktik

{% stepper %}
{% step %}

### Jalankan server lokal

Buka Laragon, lalu nyalakan servis yang diperlukan.
{% endstep %}

{% step %}

### Buat file latihan

Buat file `profil.php` di folder server lokal Anda.
{% endstep %}

{% step %}

### Tulis kode berikut

```php
<?php
echo "Nama: Andi";
echo "<br>";
echo "Kelas: XI RPL 1";
echo "<br>";
echo "Jurusan: RPL";
?>
```

{% endstep %}

{% step %}

### Simpan file

Pastikan file benar-benar tersimpan dengan ekstensi `.php`.
{% endstep %}

{% step %}

### Buka file di browser

Akses file melalui localhost sampai hasilnya tampil.
{% endstep %}
{% endstepper %}

### Penjelasan singkat

Program ini belum memakai variabel. Tujuannya memang untuk melatih alur paling dasar lebih dulu.

Anda belajar bahwa:

* file ditulis di editor
* file diproses oleh server lokal
* hasilnya terlihat di browser

### Hasil yang diharapkan

Browser menampilkan identitas sederhana, misalnya:

```
Nama: Andi
Kelas: XI RPL 1
Jurusan: RPL
```

### Hal yang perlu dicek jika gagal

* Laragon belum aktif
* file belum disimpan
* nama file salah
* lokasi file tidak sesuai
* alamat localhost tidak sesuai nama file

### Tantangan tambahan

Lakukan tiga perubahan berikut:

* ganti nama dengan nama Anda sendiri
* ganti kelas sesuai kelas Anda
* tambahkan satu baris lagi untuk hobi atau cita-cita

### Poin evaluasi praktik Bab 1.

Pastikan Anda sudah memahami poin berikut:

* Saya berhasil menyalakan localhost.
* Saya berhasil membuat file PHP dan menyimpannya di lokasi yang benar.
* Saya berhasil membuka file PHP di browser.
* Saya paham hubungan antara file `.php`, server lokal, dan output di browser.

Jika semua sudah jelas, lanjut ke [1.6 Checkpoint: Uji Pemahamanmu Sebelum Lanjut!](/php/bab-1-persiapan-awal/1.6-checkpoint-uji-pemahamanmu-sebelum-lanjut.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.devlabss.my.id/php/bab-1-persiapan-awal/praktik-setup-localhost-and-uji-coba-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
