{"id":14959,"date":"2020-06-15T12:04:26","date_gmt":"2020-06-15T12:04:26","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14959"},"modified":"2022-04-13T15:58:38","modified_gmt":"2022-04-13T15:58:38","slug":"how-to-php-setup-localhost-for-server-side-scripting","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-php-setup-localhost-for-server-side-scripting\/","title":{"rendered":"How to setup PHP in localhost for server-side scripting?"},"content":{"rendered":"\n<p>In this blog I am going to start with the beginning, So even if you are not aware to run <strong>PHP<\/strong> on your local machine you to it just following this blog, let me introduce the first<strong> XAMPP<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is XAMPP?<\/h3>\n\n\n\n<p><strong>XAMPP<\/strong> start for Cross-Platform, PHP, Mysql, Perl, Apache. <strong>XAMPP<\/strong> is a very lightweight and simple Apache distribution, So you can use it because this is available any platform and easily as <strong>Windows<\/strong>, <strong>Linux<\/strong>, or <strong>Mac<\/strong>.<\/p>\n\n\n\n<p><strong>XAMPP<\/strong> has four main components.:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Apache<\/li><li>MySql<\/li><li>PHP<\/li><li>Perl<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Apache<\/strong> is a web server process that converts PHP files into simple HTML and sends it to the web browser of a user. Apache is the most usable and famous server today, with more than 50% website using it.<\/li><\/ol>\n\n\n\n<p>2. <strong>MySQL<\/strong><br>MySQL means database almost all websites that are dynamic needs to store data for that pupose we uses a database. MySQL is most famous database management system and an open source.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li><strong>PHP<\/strong><br>PHP is a server-side scripting language that is used by world 70% websites as Facebook is also an example.<br>PHP: Hypertext Preprocessor(Recursive Acronym)<br>Server-Side Programming\/Scripting Language<br>Can be embedded directly within HTML ()<br>Files use a \u201c.php\u201d file extension.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">How to install XAMPP?<\/h3>\n\n\n\n<p>This is the first step for setup local hosts for server-side scripting. First go to google and type XAMPP download and click the first link and download XAMPP and install. This is free and easily install.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.apachefriends.org\/index.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.apachefriends.org\/index.html<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"634\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-apache-1024x634.png\" alt=\"\" class=\"wp-image-14960\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-apache-1024x634.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-apache-300x186.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-apache-768x475.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-apache.png 1087w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After that install you can look like as below image then you go to click start button of Apache and <strong>MySql<\/strong> for start <strong>XAMPP<\/strong> server<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"685\" height=\"437\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-start.png\" alt=\"\" class=\"wp-image-14961\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-start.png 685w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/xampp-start-300x191.png 300w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><\/figure>\n\n\n\n<p>and go your browser and open new tab and type :- <strong>localhost\/phpmyadmin<\/strong><br>1st go to new and click and type database name in input box and click create button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-phpmyadmin-1024x478.png\" alt=\"\" class=\"wp-image-14962\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-phpmyadmin-1024x478.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-phpmyadmin-300x140.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-phpmyadmin-768x358.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-phpmyadmin.png 1359w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After that go c drive<strong> XAMPP<\/strong> folder of<strong> htdocs<\/strong> and create a <strong>new folder<\/strong> and create a new file as<strong> .php<\/strong> extention file and run into your browser.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"111\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/php-htdocs-folder.png\" alt=\"\" class=\"wp-image-14963\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/php-htdocs-folder.png 775w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/php-htdocs-folder-300x43.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/php-htdocs-folder-768x110.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/figure>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ajcotocus\/d158ded184157a78956d7a69a567ae98.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"451\" height=\"146\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-setup.png\" alt=\"\" class=\"wp-image-14964\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-setup.png 451w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/localhost-setup-300x97.png 300w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/figure>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_69840\"><iframe loading=\"lazy\"  id=\"_ytid_35368\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_69840\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>In this blog I am going to start with the beginning, So even if you are not aware to run PHP on your local machine you to it just following&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5150],"tags":[4921,177,6228,139,6234,230,5356],"class_list":["post-14959","post","type-post","status-publish","format-standard","hentry","category-php","tag-localhost","tag-php","tag-php7","tag-scripting","tag-server-side","tag-setup","tag-xampp"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=14959"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14959\/revisions"}],"predecessor-version":[{"id":24762,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14959\/revisions\/24762"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}