php / php-src

The PHP Interpreter
https://www.php.net
Other
38.18k stars 7.75k forks source link

Allow PHPs development server to be used in production #11045

Open nbish11 opened 1 year ago

nbish11 commented 1 year ago

Description

It would be good if we could use PHPs built-in server for smaller website deployments, rather than having to use nginx, apache, caddy, swoole, amp, react php, etc.

Ideally, for development I can do php -S 0.0.0.0:8443 --dev -t public/index.php --tls-cert letsencrypt.crt --tls-key letsencrypt.key --http2

And then for development, I can do php -S 0.0.0.0:8443 --prod -t public/index.php --tls-cert localhost.crt --tls-key localhost.key --http2

And then in php file:

<?php

if (isset($DEV)) {
error_reporting(E_ALL);
}

Or something to that effect

damianwadley commented 1 year ago

Sorry but no: the PHP developers have enough on their plate running a programming language that powers about 3/4ths of the internet without adding the second duty of maintaining a fully-capable web server.

Projects like Apache, nginx, Swoole, ReactPHP, are in a much better position to deliver a quality product than we are.

bukka commented 1 year ago

I'm going to re-open this as having more capable built in web server might be desirable and it is not something that we should just reject. What I would imagine is to more re-use logic with stream in cli server which would allow more options like tls support and other things.