{"id":2430,"date":"2025-09-27T04:52:29","date_gmt":"2025-09-26T21:52:29","guid":{"rendered":"https:\/\/www.linuxid.net\/istilah\/?p=2430"},"modified":"2025-09-27T04:52:29","modified_gmt":"2025-09-26T21:52:29","slug":"php-hypertext-preprocessor","status":"publish","type":"post","link":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/","title":{"rendered":"PHP (Hypertext Preprocessor)"},"content":{"rendered":"<h2>Apa itu PHP (Hypertext Preprocessor)?<\/h2>\n<p>PHP (Hypertext Preprocessor) adalah sebuah <a href=\"https:\/\/www.linuxid.net\/istilah\/scripting-language\/\">bahasa scripting<\/a> general-purpose beserta interpreter-nya yang tersedia secara gratis dan banyak digunakan untuk pengembangan web. Bahasa ini utamanya dipakai untuk server-side scripting, meskipun juga bisa digunakan untuk command-line scripting, dan dalam batas tertentu untuk aplikasi <a href=\"https:\/\/www.linuxid.net\/istilah\/desktop\/\">desktop<\/a>. Awalnya, PHP adalah singkatan dari Personal Home Page Tools, tetapi kini PHP berarti PHP: Hypertext Preprocessor<i>,<\/i> yang menurut dokumentasi resmi PHP Group merupakan sebuah &#8220;recursive acronym.&#8221;<\/p>\n<p>Saat digunakan untuk server-side scripting, PHP ditambahkan ke dalam halaman web dengan tujuan menghasilkan konten <a href=\"https:\/\/www.linuxid.net\/istilah\/dynamic-and-static\/\">dinamis<\/a> ketika halaman tersebut diakses melalui browser. Script PHP dijalankan oleh web server sebelum halaman dikirim ke browser. Untuk mendukung proses ini, server harus memiliki PHP terinstal bersama dengan <a href=\"https:\/\/www.linuxid.net\/istilah\/parser\/\">parser<\/a> PHP &#8212; bisa berupa Common Gateway Interface (CGI) parser atau modul server.<\/p>\n<p>Ketika user meminta sebuah halaman dari server, parser akan membaca bagian PHP di halaman tersebut, mengeksekusi instruksi dalam script, lalu menghasilkan Hypertext Markup Language (HTML) sesuai hasil eksekusi. HTML ini kemudian dikirim ke browser, bersama dengan HTML statis lainnya, sehingga pengguna hanya melihat halaman web final. Karena kontennya bergantung pada hasil interpretasi script, halaman dengan PHP disebut sebagai halaman HTML dinamis.<\/p>\n<h2>Cara kerja PHP untuk server-side scripting<\/h2>\n<p>Sebuah halaman web bisa sepenuhnya terdiri dari script PHP, atau hanya berisi beberapa script PHP yang disisipkan dalam elemen HTML biasa. File halaman tersebut umumnya disimpan dengan ekstensi <span style=\"font-family: courier new, courier, monospace;\">.php<\/span>, yang memberi tahu server bahwa file mengandung script PHP. Berikut contoh sederhana file HTML bernama <i>test.php<\/i> dengan script PHP untuk menampilkan tanggal hari ini:<\/p>\n<pre><span style=\"font-family: courier new, courier, monospace;\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n  &lt;title&gt;HTML example&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n  &lt;h2&gt;Example of HTML in action&lt;\/h2&gt;\r\n  &lt;?php\r\n    $text = \"This is a test HTML script.\";\r\n    $date = date(\"M j, Y\");\r\n    echo $text.\" Today's date is &lt;b&gt;\".$date.\"&lt;\/b&gt;.\";\r\n  ?&gt;\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/span><\/pre>\n<p>Sebagian besar konten halaman di atas adalah HTML standar dengan elemen <span style=\"font-family: courier new, courier, monospace;\">&lt;head&gt;<\/span> dan <span style=\"font-family: courier new, courier, monospace;\">&lt;body&gt;<\/span>. Pada bagian <span style=\"font-family: courier new, courier, monospace;\">&lt;body&gt;<\/span>, terdapat script PHP yang dibungkus oleh tag pembuka <span style=\"font-family: courier new, courier, monospace;\">&lt;?php<\/span> dan penutup <span style=\"font-family: courier new, courier, monospace;\">?&gt;<\/span>. Semua script PHP harus selalu berada dalam tag ini, baik seluruh halaman berisi PHP maupun hanya sebagian.<\/p>\n<p>Script di atas mendefinisikan variabel <span style=\"font-family: courier new, courier, monospace;\">$text<\/span> untuk string, serta variabel <span style=\"font-family: courier new, courier, monospace;\">$date<\/span> yang mengambil tanggal saat ini lewat fungsi <span style=\"font-family: courier new, courier, monospace;\">date<\/span>. Setelah itu, digunakan perintah <span style=\"font-family: courier new, courier, monospace;\">echo<\/span> untuk menampilkan hasil gabungan dari kedua variabel dan teks tambahan. PHP menggunakan tanda titik (.) untuk melakukan concatenation. Pada perintah <span style=\"font-family: courier new, courier, monospace;\">echo<\/span> juga disisipkan markup HTML standar <span style=\"font-family: courier new, courier, monospace;\">&lt;b&gt;<\/span> dan <span style=\"font-family: courier new, courier, monospace;\">&lt;\/b&gt;<\/span> agar tanggal tampil dengan huruf tebal.<\/p>\n<p>Saat halaman <i>test.php<\/i> diakses melalui browser, server bersama parser PHP akan mengeksekusi script dan mengembalikan hasil berupa HTML biasa. Gambar berikut menunjukkan hasil halaman di <a href=\"https:\/\/www.linuxid.net\/istilah\/Google-Chrome-browser\/\">Google Chrome<\/a>, dengan teks di bawah heading utama yang dihasilkan oleh script PHP.<\/p>\n<figure class=\"main-article-image full-col\" data-img-fullsize=\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h.png\/\"><img decoding=\"async\" class=\"lazy\" src=\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png\" srcset=\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png 960w,https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h.png 1280w\" alt=\"heading generated by the PHP script\" \/><figcaption><i class=\"icon pictures\" data-icon=\"z\/\"><\/i>Tampilan halaman uji di Google Chrome, dengan teks di bawah heading utama dihasilkan oleh script PHP<\/figcaption><div class=\"main-article-image-enlarge\/\"><\/div>\n<\/figure>\n<p>PHP didukung oleh sebagian besar sistem operasi besar, termasuk Linux, macOS, Windows, dan berbagai varian Unix. Hampir semua web server modern seperti <a href=\"https:\/\/www.linuxid.net\/istilah\/Apache\/\">Apache<\/a> dan <a href=\"https:\/\/www.linuxid.net\/istilah\/IIS\/\">Microsoft Internet Information Services<\/a> juga mendukung PHP. PHP bisa terhubung ke berbagai database, termasuk MySQL, SQLite3, MongoDB, dBase, PostgreSQL, dan IBM Db2. Selain itu, PHP juga bisa berkomunikasi dengan layanan lain melalui dukungan protokol seperti <a href=\"https:\/\/www.linuxid.net\/istilah\/LDAP\/\">LDAP<\/a>, <a href=\"https:\/\/www.linuxid.net\/istilah\/IMAP-Internet-Message-Access-Protocol\/\">IMAP<\/a>, dan <a href=\"https:\/\/www.linuxid.net\/istilah\/SNMP\/\">SNMP<\/a>.<\/p>\n<p>PHP sering dibandingkan dengan ASP.NET milik Microsoft, sebuah framework web open source. Seperti ASP.NET, script PHP juga bisa disisipkan langsung dalam halaman web bersama elemen HTML.<\/p>\n<p>PHP bersifat gratis dan open source. Source code-nya tersedia di GitHub. Saat ini PHP berada di bawah lisensi PHP License versi 3.01, yang memungkinkan penggunaan baik dalam bentuk source maupun binary, dengan atau tanpa modifikasi. Lisensi ini juga mencantumkan syarat tertentu, seperti aturan terkait <a href=\"https:\/\/www.linuxid.net\/istilah\/copyright\/\">copyright<\/a>, penggunaan nama PHP, dan acknowledgment. Versi terbaru PHP adalah 8.2.3 yang dirilis pada Februari 2023.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apa itu PHP (Hypertext Preprocessor)? PHP (Hypertext Preprocessor) adalah sebuah bahasa scripting general-purpose beserta interpreter-nya yang tersedia secara gratis dan banyak digunakan untuk pengembangan web. Bahasa ini utamanya dipakai untuk server-side scripting, meskipun juga bisa digunakan untuk command-line scripting, dan dalam batas tertentu untuk aplikasi desktop. Awalnya, PHP adalah singkatan dari Personal Home Page Tools, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[45],"class_list":["post-2430","post","type-post","status-publish","format-standard","hentry","category-computer-science","tag-internet-technologies"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer\" \/>\n<meta property=\"og:description\" content=\"Apa itu PHP (Hypertext Preprocessor)? PHP (Hypertext Preprocessor) adalah sebuah bahasa scripting general-purpose beserta interpreter-nya yang tersedia secara gratis dan banyak digunakan untuk pengembangan web. Bahasa ini utamanya dipakai untuk server-side scripting, meskipun juga bisa digunakan untuk command-line scripting, dan dalam batas tertentu untuk aplikasi desktop. Awalnya, PHP adalah singkatan dari Personal Home Page Tools, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/\" \/>\n<meta property=\"og:site_name\" content=\"Istilah Komputer\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-26T21:52:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png\" \/>\n<meta name=\"author\" content=\"adhit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Ditulis oleh\" \/>\n\t<meta name=\"twitter:data1\" content=\"adhit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/\",\"url\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/\",\"name\":\"Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer\",\"isPartOf\":{\"@id\":\"https:\/\/linuxid.net\/istilah\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png\",\"datePublished\":\"2025-09-26T21:52:29+00:00\",\"author\":{\"@id\":\"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/ec7c6c711087fb70886ff5a4fe68e83d\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage\",\"url\":\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png\",\"contentUrl\":\"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/linuxid.net\/istilah\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP (Hypertext Preprocessor)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/linuxid.net\/istilah\/#website\",\"url\":\"https:\/\/linuxid.net\/istilah\/\",\"name\":\"Istilah Komputer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/linuxid.net\/istilah\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/ec7c6c711087fb70886ff5a4fe68e83d\",\"name\":\"adhit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxid.net\/istilah\/wp-content\/litespeed\/avatar\/808829c8eb1b70c161b392916104c2ba.jpg?ver=1777193465\",\"contentUrl\":\"https:\/\/www.linuxid.net\/istilah\/wp-content\/litespeed\/avatar\/808829c8eb1b70c161b392916104c2ba.jpg?ver=1777193465\",\"caption\":\"adhit\"},\"sameAs\":[\"https:\/\/linuxid.net\/istilah\"],\"url\":\"https:\/\/www.linuxid.net\/istilah\/author\/xsandradietsax\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/","og_locale":"id_ID","og_type":"article","og_title":"Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer","og_description":"Apa itu PHP (Hypertext Preprocessor)? PHP (Hypertext Preprocessor) adalah sebuah bahasa scripting general-purpose beserta interpreter-nya yang tersedia secara gratis dan banyak digunakan untuk pengembangan web. Bahasa ini utamanya dipakai untuk server-side scripting, meskipun juga bisa digunakan untuk command-line scripting, dan dalam batas tertentu untuk aplikasi desktop. Awalnya, PHP adalah singkatan dari Personal Home Page Tools, [&hellip;]","og_url":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/","og_site_name":"Istilah Komputer","article_published_time":"2025-09-26T21:52:29+00:00","og_image":[{"url":"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png","type":"","width":"","height":""}],"author":"adhit","twitter_card":"summary_large_image","twitter_misc":{"Ditulis oleh":"adhit","Estimasi waktu membaca":"3 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/","url":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/","name":"Apa itu PHP (Hypertext Preprocessor)? - Istilah Komputer","isPartOf":{"@id":"https:\/\/linuxid.net\/istilah\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage"},"thumbnailUrl":"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png","datePublished":"2025-09-26T21:52:29+00:00","author":{"@id":"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/ec7c6c711087fb70886ff5a4fe68e83d"},"breadcrumb":{"@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/"]}]},{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#primaryimage","url":"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png","contentUrl":"https:\/\/www.techtarget.com\/rms\/onlineimages\/php_test-h_mobile.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxid.net\/istilah\/php-hypertext-preprocessor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxid.net\/istilah\/"},{"@type":"ListItem","position":2,"name":"PHP (Hypertext Preprocessor)"}]},{"@type":"WebSite","@id":"https:\/\/linuxid.net\/istilah\/#website","url":"https:\/\/linuxid.net\/istilah\/","name":"Istilah Komputer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxid.net\/istilah\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Person","@id":"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/ec7c6c711087fb70886ff5a4fe68e83d","name":"adhit","image":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/linuxid.net\/istilah\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxid.net\/istilah\/wp-content\/litespeed\/avatar\/808829c8eb1b70c161b392916104c2ba.jpg?ver=1777193465","contentUrl":"https:\/\/www.linuxid.net\/istilah\/wp-content\/litespeed\/avatar\/808829c8eb1b70c161b392916104c2ba.jpg?ver=1777193465","caption":"adhit"},"sameAs":["https:\/\/linuxid.net\/istilah"],"url":"https:\/\/www.linuxid.net\/istilah\/author\/xsandradietsax\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/posts\/2430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/comments?post=2430"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/posts\/2430\/revisions"}],"predecessor-version":[{"id":6288,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/posts\/2430\/revisions\/6288"}],"wp:attachment":[{"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/media?parent=2430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/categories?post=2430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxid.net\/istilah\/wp-json\/wp\/v2\/tags?post=2430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}