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 inJ:\Userrs\White\myproject
- And type
php -S [serverip/domain:port]
In this case I typephp -S localhost:8089
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
Written by Widy Graycloud
Related protips
4 Responses
You can still access sql sockets with the build in server.
yes you're right if the socket started
you should add a small note; this only works as of PHP 5.4
oh sorry for that, i've add it