dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.7k stars 220 forks source link

Make root flag in php-server command required #364

Open shyim opened 9 months ago

shyim commented 9 months ago

You can right now start with php-server a PHP Server without passing a root folder. So it's just showing 404 pages. That flag should be required so for DX.

Also passing arguments when no expected does not throw an error. Before I read the help page, I just run frankenphp php-server ~/foo and expected it serves ~/foo as Docroot as there were no error 😓

dunglas commented 9 months ago

When you do that, it serves the content of the current directory, which is the same behavior as php -S. If you have an index.php file in the current directory (e.g: WordPress), it will be served as the default page.

shyim commented 9 months ago

OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHhh

Maybe a log entry what the current document root is? 😂

dunglas commented 9 months ago

The problem is that the document root can change for each request.