Questions tagged [php-standalone-server]

As of PHP 5.4.0, the CLI SAPI provides a built-in web server was designed to aid application development (It is not intended to be a full-featured web server).

As of PHP 5.4.0, the CLI SAPI provides a built-in web server.

PHP applications will stall if a request is blocked.

URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. If a URI request does not specify a file, then either index.php or index.html in the given directory are returned. If neither file exists, then a 404 response code is returned.

If a PHP file is given on the command line when the web server is started it is treated as a "router" script. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser.

Standard MIME types are returned for files with extensions: .3gp, .apk, .avi, .bmp, .css, .csv, .doc, .docx, .flac, .gif, .gz, .gzip, .htm, .html, .ics, .jpe, .jpeg, .jpg, .js, .kml, .kmz, .m4a, .mov, .mp3, .mp4, .mpeg, .mpg, .odp, .ods, .odt, .oga, .ogg, .ogv, .pdf, .pdf, .png, .pps, .pptx, .qt, .svg, .swf, .tar, .text, .tif, .txt, .wav, .webm, .wmv, .xls, .xlsx, .xml, .xsl, .xsd, and .zip.

Example:

php -S localhost:8000 -t /home/user/foo/

Source: Built-in web server

2 questions
0
votes
1 answer

separate xml properties from api response php

i am getting this xml as a reponse from server 201234 i want to retrieve values from this xml if i directly…
0
votes
1 answer

Why not use the dot (".") in url rewrite?

I noticed that most PHP frameworks routes (all) does not use the written urls dot and the php-standalone-server also does not use dots (note that the php-standalone-server not need mod_rewrite, it usually works). This is a pattern, I avoid dots…
Protomen
  • 9,471
  • 9
  • 57
  • 124