Blogger Text

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
                                     ***    Kindly Subscribe our Official YouTube Channel "INFOPALACESS OFFICIAL-Tuts: in this channel we upload Programming (C,C++,C# JAVA, PHP), Web Development, Graphics Editing and Microsoft Office Step by Step Tutorials from bigginer to Advance Level. We also provide free online courses at our YouTube Channel. ***   Graded Assignments/Quizes and GDB will start in Next Week. Solution ideas of All assignments, Quizes and GDB will be available here. If you have any problem regarding this then you can contact us.

Run PHP with Command Prompt without any software

Bootstrap Example

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.

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


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.

Post a Comment