frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Make root flag in php-server command required

Open shyim opened this issue 1 year ago • 3 comments
trafficstars

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 😓

shyim avatar Dec 11 '23 15:12 shyim

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.

dunglas avatar Dec 11 '23 15:12 dunglas

OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHhh

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

shyim avatar Dec 11 '23 15:12 shyim

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

dunglas avatar Dec 14 '23 00:12 dunglas