News for hackers. Stuff that matters.
Re:An Internet of PHP by xorcist on Saturday September 09, 2023 @05:30AM (#37443603)
PHP has had a built-in web server since version 5.

People use Apache or nginx because they want to, but because they need to.

Re:An Internet of PHP by la_fayette on Saturday September 09, 2023 @05:34AM (#37443625)
I think using the php built-in webserver is not an option for a production setting.
Re:An Internet of PHP by watermelon0 on Saturday September 09, 2023 @11:51AM (#37446759)
Correct. From the documentation:

Warning: This web server is designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

Re:An Internet of PHP by alaxapta7 on Saturday September 09, 2023 @06:06AM (#37443782)
The built-in web server can only process one request at a time.
Re:An Internet of PHP by charrondev on Saturday September 09, 2023 @08:26AM (#37444531)
The built in web server is awful on its own. Forget production usage, it’s hard to even use for a quick bit of E2E testing.

Unfortunately it has some really opinionated routing rules with certain file extensions, preventing you from having a dynamic URL with something like a .json or a .xml extension. Instead it will always try to look up a static file of that and serve it instead.

I can’t find the bug tracker issue for it but it was closed out with a message along the lines of “don’t use the built in web server for anything besides a toy”.

Luckily there are plenty of PHP Cli based web servers now that some other commenters have mentioned.

Re:An Internet of PHP by alaxapta7 on Saturday September 09, 2023 @10:26AM (#37445824)
You can take full control over the routing using router script, then none of the default rules will apply. To be honest, I really dislike how many applications are wired around some Apache configuration or at least assume some specific hostname or path to be used for no reason. If it works with the built-in webserver, then it will work just as well with pretty much any SAPI.
Re:An Internet of PHP by slim on Saturday September 09, 2023 @01:13PM (#37447672)
the embedded server is great for dev, but useless for production. for example any url that contains a dot "." is considered to be a static file. so for example this path does not do what it's spposed to do /login.php?token=fghjjbjkkooll.rfcgg