From 5dead758ca25f337c249db628dab0425bcdbcae9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Jul 2022 22:46:07 +0900 Subject: [PATCH 1/3] docs: improve Whoops page explanation --- .../source/installation/troubleshooting.rst | 7 ++++--- user_guide_src/source/tutorial/index.rst | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst index 8ffe659f82dc..a1fb26961696 100644 --- a/user_guide_src/source/installation/troubleshooting.rst +++ b/user_guide_src/source/installation/troubleshooting.rst @@ -68,10 +68,11 @@ That is a sign that you are in production mode and have hit an unrecoverable error, which we don't want to show to the viewer of the webapp, for better security. -You can see the error in the debug toolbar display by setting your environment to -"development" (in **.env**), and reloading the page. +You can see the error in the log file. See `CodeIgniter Error Logs`_ below. -Don't forget to reset the environment to "production" once you fix the problem! +If it is not on the production server, you should set your environment to +"development" (in **.env**). See :ref:`setting-development-mode` for the detail. +After that, reload the page. You will see the error and the back trace. CodeIgniter Error Logs ---------------------- diff --git a/user_guide_src/source/tutorial/index.rst b/user_guide_src/source/tutorial/index.rst index e940ec849057..83a58aa61c5c 100644 --- a/user_guide_src/source/tutorial/index.rst +++ b/user_guide_src/source/tutorial/index.rst @@ -53,6 +53,9 @@ Enjoy your exploration of the CodeIgniter framework. Getting Up and Running ********************** +Installing CodeIgnier +===================== + You can download a release manually from the site, but for this tutorial we will use the recommended way and install the AppStarter package through Composer. From your command line type the following:: @@ -62,6 +65,11 @@ From your command line type the following:: This creates a new folder, **ci-news**, which contains your application code, with CodeIgniter installed in the vendor folder. +.. _setting-development-mode: + +Setting Development Mode +======================== + By default, CodeIgniter starts up in production mode. This is a safety feature to keep your site a bit more secure in case settings are messed up once it is live. So first let's fix that. Copy or rename the ``env`` file to ``.env``. Open it up. @@ -74,6 +82,9 @@ out. So uncomment the line with ``CI_ENVIRONMENT`` on it, and change ``productio CI_ENVIRONMENT = development +Running Development Server +========================== + With that out of the way it's time to view your application in a browser. You can serve it through any server of your choice, Apache, Nginx, etc, but CodeIgniter comes with a simple command that takes advantage of PHP's built-in server to get From 33f507dc7dffbf6e2a5000148e27bf393f9c986e Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Jul 2022 22:46:47 +0900 Subject: [PATCH 2/3] docs: improve Initial Configuration --- user_guide_src/source/general/environments.rst | 2 ++ user_guide_src/source/installation/running.rst | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 33359425fd0b..bac1f4c394cb 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -13,6 +13,8 @@ tools loaded that you don't in production environments, etc. :local: :depth: 2 +.. _environment-constant: + The ENVIRONMENT Constant ======================== diff --git a/user_guide_src/source/installation/running.rst b/user_guide_src/source/installation/running.rst index b2ba72d4cd7f..12244932cc40 100644 --- a/user_guide_src/source/installation/running.rst +++ b/user_guide_src/source/installation/running.rst @@ -17,19 +17,19 @@ Initial Configuration & Set Up #. Open the **app/Config/App.php** file with a text editor and set your base URL. If you need more flexibility, the baseURL may - be set within the **.env** file as ``app.baseURL="http://example.com/"``. + be set within the **.env** file as ``app.baseURL = 'http://example.com/'``. (Always use a trailing slash on your base URL!) #. If you intend to use a database, open the **app/Config/Database.php** file with a text editor and set your database settings. Alternately, these could be set in your **.env** file. - -One additional measure to take in production environments is to disable -PHP error reporting and any other development-only functionality. In -CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which -is more fully described on the :doc:`environments page `. -By default, the application will run using the "production" environment. To -take advantage of the debugging tools provided, you should set the environment -to "development". +#. If it is not on the production server, set ``CI_ENVIRONMENT`` to ``development`` + in **.env** file to take advantage of the debugging tools provided. See + :ref:`setting-development-mode` for the detail. + +.. important:: In production environments, you should disable error display and + any other development-only functionality. In CodeIgniter, this can be done + by setting the environment to "production". By default, the application will + run using the "production" environment. See also :ref:`environment-constant`. .. note:: If you will be running your site using a web server (e.g., Apache or Nginx), you will need to modify the permissions for the ``writable`` folder inside From c38f6040d65b19cbd11123052cff702455785381 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 31 Jul 2022 19:56:55 +0900 Subject: [PATCH 3/3] docs: fix by proofreading Co-authored-by: MGatner --- user_guide_src/source/installation/troubleshooting.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst index a1fb26961696..992c6969ef94 100644 --- a/user_guide_src/source/installation/troubleshooting.rst +++ b/user_guide_src/source/installation/troubleshooting.rst @@ -70,8 +70,8 @@ the webapp, for better security. You can see the error in the log file. See `CodeIgniter Error Logs`_ below. -If it is not on the production server, you should set your environment to -"development" (in **.env**). See :ref:`setting-development-mode` for the detail. +If you reach this page while developing you should change your environment to +"development" (in **.env**). See :ref:`setting-development-mode` for more details. After that, reload the page. You will see the error and the back trace. CodeIgniter Error Logs