Quite interesting! I just happened to be searching for "a webserver written in php" today... Here's a few questions off the top of my head (happy to move them to GitHub if you prefer)
1. there are only 31 commits in the repo, no tags, no branches. How can one verify the "10 years of development and real life usage" ?
2. any plans to do a release soon?
3. why not adopt "/public" instead of "/web" as it is the most common name for the web root directory?
4. what about $_SERVER, $_ENV, $_GET, $_POST, $_COOKIES, I presume the value for those are set up by the webserver before forking and handing off execution to the user code?
5. if so, what about having a "psr" mode where a psr-compliant ServerRequest object instance is set up, and time/memory is saved by not populating the standard env vars? Also, a class would be nice that uses the `Q` functions to output a Prs Request, similar to what laminas\...\SapiEmitter does
5. support for virtualhosts: is there any at all?
6. support for listening on unix sockets: is there any at all? (eg. to create a proxy for the Docker socket)
7. hardening of the http parser: before I start digging into the code: what kind of testing was done to insure it is robust enough? Are f.e. super-long header lines tested for? Are unknown http methods rejected or let through by default? What about requests with 2 Host headers, etc...
8. Speaking of which: would this server be able to let php scripts tell apart an http request with 2 times the same header from a request with that header present a single time with a value equal to the comma-concatenation? In othre words: can it be used to implement smarter parsing of http headers than what the CGI/FCGI spec allows?
I assume this is highly AI generated based on the emoji and the typical structure of README.md? At the very least have it break apart WebServer.php, this is insanely too long, and what's it with all the static stuff?
And the Revolt driver [2] is missing a composer.json with the required dependency, and the code would benefit from a use statement instead of 5 fully qualified references.
Yes, these days I work with AI (Claude chat, usually) to do all the "last mile" things, like packaging, writing READMEs, etc. I iterate, do quality control, and I asked it specifically to put emojis in titles. But the actual architecture, and the 10+ years of code in the framework, were hand-rolled.
I just realized I can extract the web-server under an MIT license and gift it to everyone. So I put it up on github and then told HN about it. That's all!
Hopefully this can make it simpler to host live Wordpress sites locally with custom domains. Need to get a MySQL server in there. Could end up being sold as a "turn-key appliance" with management sold as an add-on. Rides on the whole local-first wave. Time to kickstart?
Not sure I follow. Many webservers have 55% or less of nginx throughput. NGinx is written in C, the fact that you can even achieve over half its throughput in PHP for static files is pretty incredible to me.
This server is not competing with nginx for serving static files. It's competing with nginx+php-fpm for serving PHP, and there, it wins by a large margin.
You might have a very narrow definition of "serious use". This isn't just for people who want to serve static files. This is for people who want to host PHP applications without having to manually install nginx, configure its proxy_pass to php-fpm, etc.
In some ways, in real-world scenarios, this server would actually be faster than nginx with php-fpm. Because it can prefork processes after it has loaded classes, so all that bootstrapping your PHP scripts do having to load classes over and over, (even with PHP's opcode caching) can be on the order of tens of milliseconds. That's saved per call.
You can still put nginx in front of this, by the way, for much faster https. But you can also put CloudFlare, CloudFront, or any other CDN in front of it instead, and get all the advantages of reverse proxies, etc.
But, all by itself, this server handles reverse proxy, caching (including Cache-Control headers, ETags, etc.) and, very importantly, it allows your PHP to do two things that other webservers don't:
1. Send X-Accel-Redirect headers in order to enforce true access control for static files, based on cookies etc. Gone are the days you have to host files publicly at unguessable URLs, that people can share with others.
2. Send X-Cache-... headers that actually let the server cache parts of the page rather than the whole page. When you invalidate one thing, it intelligently invalidates all the pages that transitively depend on that thing.
There's a lot more to it. You commented 2 minutes after it was posted, so I imagine you haven't actually read the README. Go and read it. Yes, it's for "serious use."
Was absolutely ready to point you out how this is a fun side project nothing serious just to show its possible, then I read the readme and wtf it does not seems like it?
Just use frankenphp and be done with it, it runs caddy, doesn't need an external php runtime and also lets you bundle your app as a single executable.
FrankenPHP uses Go. This is pure userland PHP. No other dependencies.
For one thing, developers who actually code in PHP need a web server. This "just works" out of the box. No need to install Go, or Nginx, or php-fpm, or configure proxy_pass, or certificates, etc. etc. Yes, caddy also handles certificates, but what about the rest?
There is a section in the README comparing this to FrankenPHP, Swoole, etc. You can see where this approach actually beats them. In fact, instead of simply declaring "it sux", why not try it first? It takes 5 minutes. Download and launch.
And a word about about safety. FrankenPHP workers persist between requests, which means every static variable, singleton, and global cache in your app -- and every library you use -- becomes a potential data leak between users. Qbix Server gives you the same performance benefit (zero bootstrap cost) via fork-after-preload, but each request gets its own process. When it's done, everything is gone. No audit needed.
Go is not a dependency. Go is a compiled language, once you download the frankenphp binary you do not need anything else, whereas you still need php for yours.
The readme is fully ai generated so its not a great start, but I checked anyway and yes the only thing I agree with is the lack of X-Accel-Redirect which really bother me.
I know about safety I'm literally in the process at work of going through our app to check for this exact issue since we are moving to frankenphp. And it's quite easy, unless you did something REALLY WRONG in your app, it's just a matter of implementing the ResetInterface [0]
It’s quite ironic that you are pointing out I still need PHP to run … PHP. Whereas if I download a Go binary, then I won’t.
Well, I can do you one better — you can compile the entire server and PHP code to a binary, as it says in the README, so you won’t need ANYTHING once you download that LOL.
Also, since you wrote that comment, I also added supports for websockets (wire-compatible with socket.io) and rooms, all of it with the same approach: put files in folders and it “just works”. What is so bad about that?
You are really putting bad faith and being stubborn.
Yes you will need SOMETHING since you have to get your thing someway to compile this executable. Just as you'd need frankenphp to compile a single binary just as you that will then not require anything.
Great, it's a good thing to have websocket support it's clearly lacking in the php world.
1. there are only 31 commits in the repo, no tags, no branches. How can one verify the "10 years of development and real life usage" ?
2. any plans to do a release soon?
3. why not adopt "/public" instead of "/web" as it is the most common name for the web root directory?
4. what about $_SERVER, $_ENV, $_GET, $_POST, $_COOKIES, I presume the value for those are set up by the webserver before forking and handing off execution to the user code?
5. if so, what about having a "psr" mode where a psr-compliant ServerRequest object instance is set up, and time/memory is saved by not populating the standard env vars? Also, a class would be nice that uses the `Q` functions to output a Prs Request, similar to what laminas\...\SapiEmitter does
5. support for virtualhosts: is there any at all?
6. support for listening on unix sockets: is there any at all? (eg. to create a proxy for the Docker socket)
7. hardening of the http parser: before I start digging into the code: what kind of testing was done to insure it is robust enough? Are f.e. super-long header lines tested for? Are unknown http methods rejected or let through by default? What about requests with 2 Host headers, etc...
8. Speaking of which: would this server be able to let php scripts tell apart an http request with 2 times the same header from a request with that header present a single time with a value equal to the comma-concatenation? In othre words: can it be used to implement smarter parsing of http headers than what the CGI/FCGI spec allows?
9. How does Qbix compare to previous efforts to develop a pure-php webserver, such as https://github.com/appserver-io/webserver/ ?