ni6yla
Last Updated: February 25, 2016
·
1.45K
· grazerc0de
147186f2f9c90edfc509a0b045038736

Local Server without Apache [PHP]

Almost all PHP programmers use Apache or NGINX as their server.
Even they're just coding using PHP (no SQL).
For this reson, Actually you can start your own server with just using the executable php file
in Windows (php.exe).
Thi s very useful if you want to experiment or learn more about PHP without database. You still can use MySQL if the socket was started.

Note : This only works for PHP version 5.4

Steps:

  • Fire up your terminal or command prompt in windows

  • Now cd in your web project. in my case its in J:\Userrs\White\myproject

Picture

  • And type php -S [serverip/domain:port] In this case I type php -S localhost:8089 Picture

You can set any port as long it is not being use.

  • And now fire up your facourite browser

  • Goto localhost:8089 in my case.

  • Notice the index.php in my project folder is loaded in browser

Picture

Say Thanks
Respond

4 Responses
Add your response

11150
42f94b50920417bba84e0a6dabce73ee

You can still access sql sockets with the build in server.

over 1 year ago ·
11154
147186f2f9c90edfc509a0b045038736

yes you're right if the socket started

over 1 year ago ·
11170
Bb0525f7ad9c008dbb76c7077a2f3096

you should add a small note; this only works as of PHP 5.4

over 1 year ago ·
11176
147186f2f9c90edfc509a0b045038736

oh sorry for that, i've add it

over 1 year ago ·