Oh no, that is not what I meant. I mean using server-like features from
within an Apache-based PHP installation, such as the examples I've
mentioned. For example, I implemented a file downloading routine for my
website, and because I did it through my script, I was able to
dynamically throttle the speed of the download from within PHP.
Having PHP-based server-like functionality is what I meant.
Gavin Vess wrote:
Such features are far beyond the scope or purpose of this development
tool:
http://framework.zend.com/wiki/x/tgY
I would recommend using Apache or Lighttpd or similar to obtain the
feature set below.
Cheers,
Gavin
Abu Hurayrah wrote:
Sounds like a great idea, Mat. I do have one question, though - can
it or components from it be utilized to emulate certain server-based
functions, such as file downloads & custom HTTP responses &
behaviors, from within a PHP script running as a module of, for
example, Apache? Say we want to have resumable downloads delivered
from a PHP script, or implement HTTP caching at the PHP level (sounds
strange, but let's not limit ourselves), for example.
Mat Scales wrote:
(cross posted to fw-general and fw-webservices)
I have commited an initial version of the debugging/testing web
server project into SVN. It can be found in
trunk/incubator/tools/http_server/. It is capable of serving up
static files and PHP scripts. Try it!
To run a server, start the 'server-start.php' script. It has the
following arguments:
-h <host ip> - The IP address to bind to (NOT the domain name). By
default it will bind to 127.0.0.1, which will mean that you will
only be able to access the server if you are using a web browser on
the same computer as the server.
-p <port> - Which port to bind to. Defaults to 8000.
-d </path/to/document/root/> - Set the document root to serve files
from. Defaults to current working directory.
Once you have started the server, you can connect to it at
http://<host ip>:<port>/<filename>, e.g.
http://127.0.0.1:8000/test.html
Some known issues:
* Requires PHP to be built with socket support (--enable-sockets
passed to configure)
* No current way to apply aliases or rewrite rules so MVC
applications will not work (yet)
* When visiting http://localhost:8000/ it will not look for
index.html, index.php, etc. It will in fact serve up a blank page.
* $_COOKIES and $_FILES will always be empty and some elements of
$_SERVER are not set.
* Never been tested on Windows - may or may not work!
* Doesn't meet the coding standards, there are no unit tests and
this is the only documentation. Not that any of that is important ;)