Skip to content

Commit

Permalink
Merge pull request #6316 from kenjis/fix-docs-whoops
Browse files Browse the repository at this point in the history
docs: improve Whoops page explanation and Initial Configuration
  • Loading branch information
kenjis authored Aug 1, 2022
2 parents a1a6358 + c38f604 commit d7ba764
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 2 additions & 0 deletions user_guide_src/source/general/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ tools loaded that you don't in production environments, etc.
:local:
:depth: 2

.. _environment-constant:

The ENVIRONMENT Constant
========================

Expand Down
18 changes: 9 additions & 9 deletions user_guide_src/source/installation/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </general/environments>`.
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
Expand Down
7 changes: 4 additions & 3 deletions user_guide_src/source/installation/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
----------------------
Expand Down
11 changes: 11 additions & 0 deletions user_guide_src/source/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit d7ba764

Please sign in to comment.