Hello everyone! Welcome to DMForum.net This is the first post here so, I made it as useful as possible.
Have you been longing to learn PHP but is afraid of doing so since php files does not just run in the browser after a couple of clicks just as html files do? Well, rejoice! Because I am here to teach you (step by step) the procedures in Installing XAMPP (a local web server) on windows and finally running your very first PHP file in the browser! Let's Get Started!
Just as a boat needs an oar to move, you as well has to have the prerequisites to proceed!
Just as you would install any .exe files, go to downloads and locate the XAMPP installation setup! Give it a double click and an installation wizard would appear! Right?
Just click next, next and next and leave every choices default and finally, hit install. Installation would take more than 3 minutes or longer depending on your Machine.
2.) Locating HTDOCS and Exploring Sublime
Now that we're done installing XAMPP, it's now time for us to create your very first PHP file!
Firstly, go to your xampp installation directory (Usually C:/xampp). Locate the folder named 'htdocs' and open it! You will see an empty directory depicting a sandbox for your future PHP Projects. This directory will store all of our PHP projects and files.
Now, open sublime text 3. In the menu bar above, click 'File' then in the list, click 'Open Folder'.
Cool! Now locate the htdocs folder which we've just visited and hit add folder.
3.) Create your first PHP File!
Okay! Our server is set and our text editor is ready to be coded into. We have only one final thing left to make your PHP dream happen -- the File!
Inside sublime text, head over to the menu bar above and click 'File'. After that, click 'New File'. Give it a name of index.php.
Hit ctrl + s and locate the htdocs folder (again). Open it and hit save!
You should see the file on the project structure in the left appended right below the htdocs directory. See it? Cool!
4.) Write PHP Code!
Now that we're all set! Let's get coding!
In the text editor, type in the following.
<?php echo "Hello, World!" ?>
Hit ctrl+s to save the file! Now it's time to run it!
5.) Run the code in the browser!
We are at the final stage! Now to finally see if our xampp installation was successful, go ahead and open XAMPP control panel. (You can search it in the windows start).
Start the first two options namely, Apache and MySQL. Now it's turned on, head over to the browser. Something exciting is waiting for you.
In the address bar, type in the following:
Hit enter and lo and behold! Our PHP file has run!
If you see hello world, Congratulations. XAMPP is now 100% installed in your machine! But dont just leave yet, I will be giving free PHP learning materials at the very bottom! If you want, go ahead and check it out!
However, if you didn't see the Hello World Message. Dont worry, you didn't failed! You might have just forgotten something! Here are the options you might want to try!
1.) Do the whole procedure again
2.) Comment down so I could help you out personally
3.) Go for community/facebook groups and ask for help.
Thanks for reading! Are you loving the stuffs we're sharing here?
Or maybe, there's something you want to ask and post a comment
right under the content? Well, I guess, you might want to create an account
or if you already have then, login. Creating an account serves as a subscription
and a support for us authors to create more stuffs like this! Go ahead and choose
among the buttons below! God bless and Thank you.
~ Rustine Dave