My Aim to Provide you quality contents, Tips & Tricks, Software, Microsoft Office, Graphic Editing (Adobe PhotoShop, After Affects, Illustrator, inDesign) Corel Draw, Corel Video Studio, Cyberlink PowerDirector, Power ActionCinema, Tutorials about Blogging and VU Assignments, Quizes & GDB Solutions and Much More... at regular Basis
Since PHP stands for "Preprocessor Hypertext" and this is a Server Side Scripting language, lot of website development using PHP is done on a live web environment. However, PHP does allow you to install it and run scripts on your local machine with no web access needed.
Running PHP from Windows command line (Command Prompt) is a very usefull to run any php script without using andy 3rd party server like xampp or wampp etc.
In today's tutorial I am going to tell you how to run any php script with command prompt. Follow simple steps to run php script.
Watch the video below with step by step guide.
video will be uploaded soon
Step 01:
First of all Download php files by visiting php official website by simply click here to
Now download Threaded Safe in zip format file (round about 28MB size) for windows or Mac according to your OS.
Step 02:
Now Extract that file in to C:\PHP7. After Extracting the folder you see a nee folder as PHP7 will be created in c: drive.
just like figure below;
Step 03:
Now open Command Prompt from Start Menu or just type CMD in search or run bar.
After Opening Command Prompt just type php -v and hit enter key. You will see the PHP version info.
Note If you don't see any version info then there is something wrong with your version. In that case you need to follow above mentioned steps carefully.
Step 04:
If you see your installed php version info in command prompt by following step 3 then now you just need to type php -S localhost:4000 and Press Enter key to set server address.
In above command we wrote localhost:4000 Remember it this is over server URL which is help us to run over php script. for more info in detail just watch video above.
Step 05:
Now Open your browser and Enter your server URL Address which we set in step 4. and after word enter your php script name and press enter to run it.
for example if your php file is at desktop with folder phpproject and file name test.php then you need to enter url address like this localhost:4000/phpproject/test.php
Remember! if your php project is in other location like D drive or desktop then first of you also need to change you directory in cmd before running php -S.
For example your phpproject is on desktop then you just need to enter cd desktop command in command prompt and press enter. after that then you enter php -S localhost:4000 command.
for detail just to watch video tutorial.
Picture
I hope you will like post. Because now you are able to run your php script/pages/website locally on your pc without using any third party application/software like xampp wampp or any other software like these.
if you steel have any confusion or need help then just comment below. I will respond you as soon as possible.
0 Comments