Hello friends I'm again here with old but interesting topic, this is fully dedicated to beginners who don't to anything about Setup PHP server and taking everything very complex to start. Don't worry I will try describe everything very simple as possible.
Why setup PHP workbench is important for beginners ?
Hmm, it's common questing and strike in your mind before your startup, let me clear why important for you.
We all know well PHP is OpenSource Programming Language and leading in web technologies. After implementation of OOPS it's become more powerful and interesting.
Most of top website running on PHP as Google, Facebook etc, also PHP is a platform independent language.
Servr setup in PHP is very easy and completely free. Supporting multiple databases also there are so many advantages but I think you can get details more better if you go official website http://php.net/ .
Let's setup first PHP workbench very easy:
Php is a server side scripting language that's so you should need a server to run, one min. please if you a question in your mind "what is server side scripting language ?".
If you try to run a simple .html file then it will directly run on your browser, also after implement some javascript code it will run as normal without any worry. But when you try to run a .php file you can't.
That's why it's called server side scripting language.
Installation PHP Apache Server : There are several type of free servers (WAMP,XAMPP etc) but I'm going to install XAMPP.
Download XAMPP from https://www.apachefriends.org/download.html .
Now we will do a most important thing to avoid port block, because normally your Apache run on port 80 and if you are using skype then most probability unable to run due to Already Busy Port.
Changing Apache Port in XAMPP to Avoid Port Conflict Issue-
Goto C:\xampp\apache\conf and open httpd.conf and search for below line:
Listen 80 ServerName localhost:80
Change 80 to as you want, example I'm changing 80 to 82. After that close XAMPP if it's running on Windows Tray and restart XAMPP and start Apache and MySQL as below image.
After that open http://localhost:82/ in your browser to check your server live or not.
Making your First PHP web page:
After server setup it's time to check everything well or not. We are going to make a .php file and echo a welcome message.
Goto C:\xampp\htdocs\ and create a folder test and in that folder create a simple .php file name as index.php using notepad and write follow lines.
<?php echo "TricksWay Welcomes You"; ?>
Save above and open your browser and access http:localhost:82/test/ you will see result as below image.
That's all you done, your first PHP workbench setup well.
How to Setup MySQL command prompt in Windows ?
It's not necessary to know this at the time but I'm sharing so you can learn it if you want. It will helps you in future when you go for learn MySQL.
Open CMD from Windows Start Menu and Type command line one by one as below: (I'm setting up for XAMPP you can change directory if you are using another instead of XAMPP )
cd \ cd xampp cd mysql cd bin mysql -u root -p
After that it will ask for password, remembers it's not asking your PC password so leave it blank and hit enter if you didn't changed in MySql.
I tried to clear everything as my best, but as human may I failed to clear something so in that case just left your comment. I will try to reply as soon as time allow.