From f5f49c7265f0287b3a4e09716b5b7cc6876014eb Mon Sep 17 00:00:00 2001 From: Tim Werdin Date: Wed, 1 Apr 2020 09:09:32 +0200 Subject: [PATCH 1/3] Adds block about PHP-FPM behaviour Related to the issue https://github.com/symfony/cli/issues/178 I added some documentation on the behaviour of the PHP-FPM in the webserver. Even though the behaviour is currently "expected" it is not obvious for the user. --- setup/symfony_server.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 4dc290e58a8..85b229bf01d 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -57,6 +57,20 @@ run the Symfony server in the background: # show the latest log messages $ symfony server:log +Enabling PHP-FPM +---------------- + +When the server starts it will check the ``public`` folder for an ``index.php`` +file. If this file is found the server will automatically start with PHP-FPM +enabled. Otherwise the server will start without PHP-FPM and will show a +``Page not found`` page when trying to access a ``.php`` file in the browser. + +.. tip:: + + When an index.html and an index.php file are present the server will still + start with PHP-FPM enabled but browsing the root of your website will serve + the index.html file. + Enabling TLS ------------ From c7419b24d306921c1a3ffd96626dabcc8dd0bb11 Mon Sep 17 00:00:00 2001 From: Tim Werdin Date: Thu, 2 Apr 2020 13:24:42 +0200 Subject: [PATCH 2/3] Improved tip message to make it more clear that the index.html takes precedence over the index.php --- setup/symfony_server.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 85b229bf01d..9aa50872cde 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -68,8 +68,10 @@ enabled. Otherwise the server will start without PHP-FPM and will show a .. tip:: When an index.html and an index.php file are present the server will still - start with PHP-FPM enabled but browsing the root of your website will serve - the index.html file. + start with PHP-FPM enabled but the index.html will take precedence over the + index.php file. This means when an index.html file is present in + ``public``, it will be displayed instead of the index.php which would show + e.g. the Symfony application. Enabling TLS ------------ From 530a8d2b695e1974117bac763035c5a72758d95b Mon Sep 17 00:00:00 2001 From: Tim Werdin Date: Fri, 3 Apr 2020 07:29:54 +0200 Subject: [PATCH 3/3] Improved PHP-FPM section to list the common patterns to find a front controller --- setup/symfony_server.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 9aa50872cde..923ac149fca 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -60,18 +60,20 @@ run the Symfony server in the background: Enabling PHP-FPM ---------------- -When the server starts it will check the ``public`` folder for an ``index.php`` -file. If this file is found the server will automatically start with PHP-FPM -enabled. Otherwise the server will start without PHP-FPM and will show a -``Page not found`` page when trying to access a ``.php`` file in the browser. +When the server starts it will check for common patterns like ``web/app.php``, +``web/app_dev.php`` or ``public/index.php``. If a file like this is found the +server will automatically start with PHP-FPM enabled. Otherwise the server will +start without PHP-FPM and will show a ``Page not found`` page when trying to +access a ``.php`` file in the browser. .. tip:: - When an index.html and an index.php file are present the server will still - start with PHP-FPM enabled but the index.html will take precedence over the - index.php file. This means when an index.html file is present in - ``public``, it will be displayed instead of the index.php which would show - e.g. the Symfony application. + When an ``index.html`` and a front controller like e.g. ``index.php`` are + both present the server will still start with PHP-FPM enabled but the + ``index.html`` will take precedence over the front controller. This means + when an ``index.html`` file is present in ``public`` or ``web``, it will be + displayed instead of the ``index.php`` which would show e.g. the Symfony + application. Enabling TLS ------------