{"id":169,"date":"2021-03-08T03:41:04","date_gmt":"2021-03-08T03:41:04","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=169"},"modified":"2025-04-05T13:53:32","modified_gmt":"2025-04-05T13:53:32","slug":"what-is-php","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/what-is-php\/","title":{"rendered":"What is PHP"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn about PHP, how it works, what it can do, and its advantages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-php'>Introduction to PHP <a href=\"#introduction-to-php\" class=\"anchor\" id=\"introduction-to-php\" title=\"Anchor for Introduction to PHP\">#<\/a><\/h2>\n\n\n\n<p>PHP is a server-side and general-purpose scripting language especially suited for web development.<\/p>\n\n\n\n<p>PHP originally stood for <strong>Personal Home Page<\/strong>. However, now, it stands for <strong>Hypertext Preprocessor<\/strong>. It&#8217;s a recursive acronym because the first word is also an acronym.<\/p>\n\n\n\n<p>PHP was created by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Rasmus_Lerdorf\" target=\"_blank\" rel=\"noreferrer noopener\">Rasmus Lerdorf<\/a> in 1994. It&#8217;s currently maintained by the <a href=\"https:\/\/www.php.net\/credits.php\" target=\"_blank\" rel=\"noreferrer noopener\">PHP Development Team<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='php-is-a-server-side-language'>PHP is a server-side language <a href=\"#php-is-a-server-side-language\" class=\"anchor\" id=\"php-is-a-server-side-language\" title=\"Anchor for PHP is a server-side language\">#<\/a><\/h3>\n\n\n\n<p>When you open a website on your web browser, for example, https:\/\/www.phptutorial.net<\/p>\n\n\n\n<p>The web browser sends an HTTP request to a web server where phptutorial.net is located. The web server receives the request and responds with an HTML document.<\/p>\n\n\n\n<p>In this example, the web browser is a client, while the web server is the server. The client requests for a page, and the server serves the request.<\/p>\n\n\n\n<p>PHP runs on the web server, processes the request, and returns the HTML document.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='php-is-a-general-purpose-language'>PHP is a general-purpose language <a href=\"#php-is-a-general-purpose-language\" class=\"anchor\" id=\"php-is-a-general-purpose-language\" title=\"Anchor for PHP is a general-purpose language\">#<\/a><\/h3>\n\n\n\n<p>Regarding the purpose of programming languages, there are two main types: domain-specific and general-purpose languages.<\/p>\n\n\n\n<p>Domain-specific languages are used within specific application domains. For example, SQL is a domain-specific language. It&#8217;s used mainly for querying data from relational databases and cannot be used for other purposes.<\/p>\n\n\n\n<p>On the other hand, PHP is a general-purpose language because PHP can develop various applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='php-is-a-cross-platform-language'>PHP is a cross-platform language <a href=\"#php-is-a-cross-platform-language\" class=\"anchor\" id=\"php-is-a-cross-platform-language\" title=\"Anchor for PHP is a cross-platform language\">#<\/a><\/h3>\n\n\n\n<p>PHP can run on all major operating systems, including Linux, Windows, and macOS.<\/p>\n\n\n\n<p>PHP can be used with all leading web servers, such as Nginx, OpenBSD, and Apache. Some cloud environments, such as Microsoft Azure and Amazon AWS, also support PHP.<\/p>\n\n\n\n<p>PHP is quite flexible. It&#8217;s not just limited to processing HTML. PHP supports generating PDF, GIF, JPEG, and PNG images.<\/p>\n\n\n\n<p>One notable feature of PHP is that it supports many databases, including MySQL, PostgreSQL, MS SQL, db2, Oracle Database, and MongoDB.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='what-can-php-do'>What can PHP do <a href=\"#what-can-php-do\" class=\"anchor\" id=\"what-can-php-do\" title=\"Anchor for What can PHP do\">#<\/a><\/h2>\n\n\n\n<p>PHP has two main applications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Server-side scripting &#8211; PHP is well-suited for developing dynamic websites and web applications.<\/li>\n\n\n\n<li>Command-line scripting: Like <a href=\"https:\/\/www.pythontutorial.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a> and <a href=\"https:\/\/www.perltutorial.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Perl<\/a>, you can run PHP scripts from the command line to perform administrative tasks like sending emails and generating PDF files.<\/li>\n<\/ul>\n\n\n\n<p>The tutorials on this website mainly focus on server-side scripting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='how-php-works'>How PHP Works <a href=\"#how-php-works\" class=\"anchor\" id=\"how-php-works\" title=\"Anchor for How PHP Works\">#<\/a><\/h2>\n\n\n\n<p>The following illustrates how PHP works:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"281\" src=\"https:\/\/phptutorial.net\/wp-content\/uploads\/2021\/03\/What-is-PHP-How-PHP-works.png\" alt=\"\" class=\"wp-image-172\" srcset=\"https:\/\/www.phptutorial.net\/wp-content\/uploads\/2021\/03\/What-is-PHP-How-PHP-works.png 692w, https:\/\/www.phptutorial.net\/wp-content\/uploads\/2021\/03\/What-is-PHP-How-PHP-works-300x122.png 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n<\/div>\n\n\n<p>How PHP works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, the web browser sends an HTTP request to the web server, e.g., index.php.<\/li>\n\n\n\n<li>Second, the PHP preprocessor located on the web server processes PHP code to generate the HTML document.<\/li>\n\n\n\n<li>Third, the web server returns the HTML document to the web browser.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='advantages-of-php'>Advantages of PHP <a href=\"#advantages-of-php\" class=\"anchor\" id=\"advantages-of-php\" title=\"Anchor for Advantages of PHP\">#<\/a><\/h2>\n\n\n\n<p>Since PHP is designed for the web in the first place, it brings many advantages to web development:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simple &#8211; PHP is quite easy to learn and get started.<\/li>\n\n\n\n<li>Fast &#8211; PHP websites typically run very fast.<\/li>\n\n\n\n<li>Stable &#8211; PHP is stable since it has existed for a long time.<\/li>\n\n\n\n<li>Open-source and free &#8211; PHP is open-source and free. You don&#8217;t have to pay a license fee to use PHP to develop software products.<\/li>\n\n\n\n<li>Community support &#8211; PHP has an active online community that helps you whenever you face an issue.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"169\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/what-is-php\/\"\n\t\t\t\tdata-post-title=\"What is PHP\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"169\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/what-is-php\/\"\n\t\t\t\tdata-post-title=\"What is PHP\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you&#8217;ll learn about PHP, how it works, what it can do, and its advantages. Introduction to PHP # PHP is a server-side and general-purpose scripting language especially suited for web development. PHP originally stood for Personal Home Page. However, now, it stands for Hypertext Preprocessor. It&#8217;s a recursive acronym because the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":2929,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/169\/revisions\/2929"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/15"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}