Skip to content

Commit d7ba764

Browse files
authored
Merge pull request #6316 from kenjis/fix-docs-whoops
docs: improve Whoops page explanation and Initial Configuration
2 parents a1a6358 + c38f604 commit d7ba764

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

user_guide_src/source/general/environments.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ tools loaded that you don't in production environments, etc.
1313
:local:
1414
:depth: 2
1515

16+
.. _environment-constant:
17+
1618
The ENVIRONMENT Constant
1719
========================
1820

user_guide_src/source/installation/running.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ Initial Configuration & Set Up
1717

1818
#. Open the **app/Config/App.php** file with a text editor and
1919
set your base URL. If you need more flexibility, the baseURL may
20-
be set within the **.env** file as ``app.baseURL="http://example.com/"``.
20+
be set within the **.env** file as ``app.baseURL = 'http://example.com/'``.
2121
(Always use a trailing slash on your base URL!)
2222
#. If you intend to use a database, open the
2323
**app/Config/Database.php** file with a text editor and set your
2424
database settings. Alternately, these could be set in your **.env** file.
25-
26-
One additional measure to take in production environments is to disable
27-
PHP error reporting and any other development-only functionality. In
28-
CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which
29-
is more fully described on the :doc:`environments page </general/environments>`.
30-
By default, the application will run using the "production" environment. To
31-
take advantage of the debugging tools provided, you should set the environment
32-
to "development".
25+
#. If it is not on the production server, set ``CI_ENVIRONMENT`` to ``development``
26+
in **.env** file to take advantage of the debugging tools provided. See
27+
:ref:`setting-development-mode` for the detail.
28+
29+
.. important:: In production environments, you should disable error display and
30+
any other development-only functionality. In CodeIgniter, this can be done
31+
by setting the environment to "production". By default, the application will
32+
run using the "production" environment. See also :ref:`environment-constant`.
3333

3434
.. note:: If you will be running your site using a web server (e.g., Apache or Nginx),
3535
you will need to modify the permissions for the ``writable`` folder inside

user_guide_src/source/installation/troubleshooting.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ That is a sign that you are in production mode and have hit an
6868
unrecoverable error, which we don't want to show to the viewer of
6969
the webapp, for better security.
7070

71-
You can see the error in the debug toolbar display by setting your environment to
72-
"development" (in **.env**), and reloading the page.
71+
You can see the error in the log file. See `CodeIgniter Error Logs`_ below.
7372

74-
Don't forget to reset the environment to "production" once you fix the problem!
73+
If you reach this page while developing you should change your environment to
74+
"development" (in **.env**). See :ref:`setting-development-mode` for more details.
75+
After that, reload the page. You will see the error and the back trace.
7576

7677
CodeIgniter Error Logs
7778
----------------------

user_guide_src/source/tutorial/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Enjoy your exploration of the CodeIgniter framework.
5353
Getting Up and Running
5454
**********************
5555

56+
Installing CodeIgnier
57+
=====================
58+
5659
You can download a release manually from the site, but for this tutorial we will
5760
use the recommended way and install the AppStarter package through Composer.
5861
From your command line type the following::
@@ -62,6 +65,11 @@ From your command line type the following::
6265
This creates a new folder, **ci-news**, which contains your application code, with
6366
CodeIgniter installed in the vendor folder.
6467

68+
.. _setting-development-mode:
69+
70+
Setting Development Mode
71+
========================
72+
6573
By default, CodeIgniter starts up in production mode. This is a safety feature
6674
to keep your site a bit more secure in case settings are messed up once it is live.
6775
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
7482

7583
CI_ENVIRONMENT = development
7684

85+
Running Development Server
86+
==========================
87+
7788
With that out of the way it's time to view your application in a browser. You can
7889
serve it through any server of your choice, Apache, Nginx, etc, but CodeIgniter
7990
comes with a simple command that takes advantage of PHP's built-in server to get

0 commit comments

Comments
 (0)