From 455d613198e969618db41c40b377c130b1a8eb8d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 14 Aug 2019 09:35:01 +0200 Subject: [PATCH] Simplified the docs about Symfony technical requirements --- _build/redirection_map | 1 + best_practices/creating-the-project.rst | 5 +- deployment.rst | 4 +- migration.rst | 6 +- reference/index.rst | 1 - reference/map.rst.inc | 1 - reference/requirements.rst | 74 ------------------------- setup.rst | 33 ++++++++--- 8 files changed, 33 insertions(+), 92 deletions(-) delete mode 100644 reference/requirements.rst diff --git a/_build/redirection_map b/_build/redirection_map index f9c0a2b3fc3..c04be4fd4d6 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -444,3 +444,4 @@ /routing/extra_information /routing /console/request_context /routing /form/action_method /forms +/reference/requirements /setup diff --git a/best_practices/creating-the-project.rst b/best_practices/creating-the-project.rst index e323d6bcf7a..2c5ea8a5d55 100644 --- a/best_practices/creating-the-project.rst +++ b/best_practices/creating-the-project.rst @@ -39,10 +39,9 @@ create files and execute the following commands: This command creates a new directory called ``blog`` that contains a fresh new project based on the most recent stable Symfony version available. -.. tip:: +.. seealso:: - The technical requirements to run Symfony are simple. If you want to check - if your system meets those requirements, read :doc:`/reference/requirements`. + Check out the :ref:`technical requirements for running Symfony applications `. Structuring the Application --------------------------- diff --git a/deployment.rst b/deployment.rst index ebab725db8f..6a0dcd26874 100644 --- a/deployment.rst +++ b/deployment.rst @@ -118,8 +118,8 @@ you'll need to do: A) Check Requirements ~~~~~~~~~~~~~~~~~~~~~ -Use the :doc:`Symfony Requirements Checker ` to check -if your server meets the technical requirements to run Symfony applications. +Use the ``check:requirements`` command to check if your server meets the +:ref:`technical requirements for running Symfony applications `. .. _b-configure-your-app-config-parameters-yml-file: diff --git a/migration.rst b/migration.rst index 4b6e6838c5f..89bfd5c21c1 100644 --- a/migration.rst +++ b/migration.rst @@ -62,9 +62,9 @@ First of all your environment needs to be able to support the minimum requirements for both applications. In other words, when the Symfony release you aim to use requires PHP 7.1 and your existing application does not yet support this PHP version, you will probably have to upgrade -your legacy project. You can find out the -:doc:`requirements ` for running Symfony and -compare them with your current application's environment to make sure you +your legacy project. Use the ``check:requirements`` command to check if your +server meets the :ref:`technical requirements for running Symfony applications ` +and compare them with your current application's environment to make sure you are able to run both applications on the same system. Having a test system, that is as close to the production environment as possible, where you can just install a new Symfony project next to the existing one diff --git a/reference/index.rst b/reference/index.rst index 1cffe82fdcd..82edbcc0130 100644 --- a/reference/index.rst +++ b/reference/index.rst @@ -22,6 +22,5 @@ Reference Documents dic_tags events - requirements .. include:: /reference/map.rst.inc diff --git a/reference/map.rst.inc b/reference/map.rst.inc index 552799df0a4..aa92cebc144 100644 --- a/reference/map.rst.inc +++ b/reference/map.rst.inc @@ -28,4 +28,3 @@ * :doc:`/reference/dic_tags` * :doc:`/reference/events` - * :doc:`/reference/requirements` diff --git a/reference/requirements.rst b/reference/requirements.rst deleted file mode 100644 index 6174e9d9697..00000000000 --- a/reference/requirements.rst +++ /dev/null @@ -1,74 +0,0 @@ -.. index:: - single: Requirements - -.. _requirements-for-running-symfony2: - -Requirements for Running Symfony -================================ - -These are the technical requirements to run Symfony 4 applications: - -* **PHP version**: 7.1.3 or higher -* **PHP extensions**: (all of them are installed and enabled by default in PHP 7+) - - * `Ctype`_ - * `iconv`_ - * `JSON`_ - * `PCRE`_ - * `Session`_ - * `SimpleXML`_ - * `Tokenizer`_ - -* **Writable directories**: (must be writable by the web server) - - * The project's cache directory (``var/cache/`` by default, but the app can - :ref:`override the cache dir `) - * The project's log directory (``var/log/`` by default, but the app can - :ref:`override the logs dir `) - -Checking Requirements Automatically ------------------------------------ - -To make things simple, Symfony provides a tool to quickly check if your system -meets these requirements. In addition, the tool provides recommendations if -applicable. - -Run this command to install the tool: - -.. code-block:: terminal - - $ cd your-project/ - $ composer require symfony/requirements-checker - -Beware that PHP may use different configurations for the command console and -the web server, so you need to check the requirements in both environments. - -Checking Requirements for the Web Server ----------------------------------------- - -The requirements checker tool creates a file called ``check.php`` in the -``public/`` directory of your project. Open that file with your browser to check -the requirements. - -Once you've fixed all the reported issues, uninstall the requirements checker -to avoid leaking internal information about your application to visitors: - -.. code-block:: terminal - - $ cd your-project/ - $ composer remove symfony/requirements-checker - -Checking Requirements for the Command Console ---------------------------------------------- - -The requirements checker tool adds a script to your Composer configuration to -check the requirements automatically. There's no need to execute any command; if -there are any issues, you'll see them in the console output. - -.. _`iconv`: https://php.net/book.iconv -.. _`JSON`: https://php.net/book.json -.. _`Session`: https://php.net/book.session -.. _`Ctype`: https://php.net/book.ctype -.. _`Tokenizer`: https://php.net/book.tokenizer -.. _`SimpleXML`: https://php.net/book.simplexml -.. _`PCRE`: https://php.net/book.pcre diff --git a/setup.rst b/setup.rst index d667814ab25..9eb37355dac 100644 --- a/setup.rst +++ b/setup.rst @@ -10,17 +10,27 @@ Installing & Setting up the Symfony Framework Do you prefer video tutorials? Check out the `Stellar Development with Symfony`_ screencast series. +.. _symfony-tech-requirements: + Technical Requirements ---------------------- Before creating your first Symfony application you must: -* Make sure to have PHP 7.1 or higher installed (and :doc:`these PHP extensions ` - which are installed and enabled by default by PHP); +* Install PHP 7.1 or higher and these PHP extensions (which are installed and + enabled by default in most PHP 7 installations): `Ctype`_, `iconv`_, `JSON`_, + `PCRE`_, `Session`_, `SimpleXML`_, and `Tokenizer`_; * `Install Composer`_, which is used to install PHP packages; * `Install Symfony`_, which creates in your computer a binary called ``symfony`` that provides all the tools you need to develop your application locally. +The ``symfony`` binary provides a tool to check if your computer meets these +requirements. Open your console terminal and run this command: + +.. code-block:: terminal + + $ symfony check:requirements + .. _creating-symfony-applications: Creating Symfony Applications @@ -57,6 +67,12 @@ will create a new ``my_project_name/`` directory, download some dependencies into it and even generate the basic directories and files you'll need to get started. In other words, your new application is ready! +.. note:: + + The project's cache and logs directory (by default, ``/var/cache/`` + and ``/var/log/``) must be writable by the web server. If you have + any issue, read how to :doc:`set up permissions for Symfony applications `. + Running Symfony Applications ---------------------------- @@ -81,12 +97,6 @@ Open your browser and navigate to ``http://localhost:8000/``. If everything is working, you'll see a welcome page. Later, when you are finished working, stop the server by pressing ``Ctrl+C`` from your terminal. -.. tip:: - - If you're having any problems running Symfony, your system may be missing - some technical requirements. Use the :doc:`Symfony Requirements Checker ` - tool to make sure your system is set up. - .. _install-existing-app: Setting up an Existing Symfony Project @@ -258,3 +268,10 @@ Learn More .. _`Main recipe repository`: https://github.com/symfony/recipes .. _`Contrib recipe repository`: https://github.com/symfony/recipes-contrib .. _`Symfony Recipes documentation`: https://github.com/symfony/recipes/blob/master/README.rst +.. _`iconv`: https://php.net/book.iconv +.. _`JSON`: https://php.net/book.json +.. _`Session`: https://php.net/book.session +.. _`Ctype`: https://php.net/book.ctype +.. _`Tokenizer`: https://php.net/book.tokenizer +.. _`SimpleXML`: https://php.net/book.simplexml +.. _`PCRE`: https://php.net/book.pcre