Skip to content

Commit ec8ba91

Browse files
authored
Merge pull request #7873 from kenjis/docs-baseURL
docs: improve on Site URIs setting
2 parents 93670c5 + 559b09d commit ec8ba91

File tree

4 files changed

+49
-27
lines changed

4 files changed

+49
-27
lines changed

user_guide_src/source/general/environments.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ config using `SetEnv <https://httpd.apache.org/docs/2.4/mod/mod_env.html#setenv>
7575
7676
.. _environment-nginx:
7777

78-
Nginx
78+
nginx
7979
-----
8080

81-
Under Nginx, you must pass the environment variable through the ``fastcgi_params``
81+
Under nginx, you must pass the environment variable through the ``fastcgi_params``
8282
in order for it to show up under the ``$_SERVER`` variable. This allows it to work on the
8383
virtual-host level, instead of using `env` to set it for the entire server, though that
8484
would work fine on a dedicated server. You would then modify your server config to something
@@ -97,7 +97,7 @@ like:
9797
}
9898
}
9999
100-
Alternative methods are available for Nginx and other servers, or you can
100+
Alternative methods are available for nginx and other servers, or you can
101101
remove this logic entirely and set the constant based on the server's IP address
102102
(for instance).
103103

user_guide_src/source/general/urls.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Query page=2
6363
Removing the index.php file
6464
===========================
6565

66-
By default, the **index.php** file will be included in your URLs::
66+
When you use Apache Web Server, by default, the **index.php** file will be needed in your URLs::
6767

6868
example.com/index.php/news/article/my_article
6969

@@ -95,10 +95,10 @@ request for your index.php file.
9595

9696
.. _urls-remove-index-php-nginx:
9797

98-
NGINX
98+
nginx
9999
-----
100100

101-
Under NGINX, you can define a location block and use the ``try_files`` directive to get the same effect as we did with
101+
Under nginx, you can define a location block and use the ``try_files`` directive to get the same effect as we did with
102102
the above Apache configuration:
103103

104104
.. code-block:: nginx

user_guide_src/source/installation/running.rst

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,53 @@ section of the User Guide to begin learning how to build dynamic PHP application
2525
Initial Configuration
2626
*********************
2727

28-
#. Open the **app/Config/App.php** file with a text editor and
29-
set your base URL to ``$baseURL``. If you need more flexibility, the baseURL may
30-
be set within the :ref:`.env <dotenv-file>` file as ``app.baseURL = 'http://example.com/'``.
31-
(Always use a trailing slash on your base URL!)
28+
Configure for Your Site URIs
29+
============================
30+
31+
Open the **app/Config/App.php** file with a text editor.
32+
33+
#. $baseURL
34+
Set your base URL to ``$baseURL``. If you need more flexibility, the baseURL may
35+
be set within the :ref:`.env <dotenv-file>` file as ``app.baseURL = 'http://example.com/'``.
36+
**Always use a trailing slash on your base URL!**
3237

3338
.. note:: If you don't set the ``baseURL`` correctly, in development mode,
3439
the debug toolbar may not load properly and web pages may take considerably
3540
longer to display.
3641

37-
#. If you intend to use a database, open the
38-
**app/Config/Database.php** file with a text editor and set your
39-
database settings. Alternately, these could be set in your **.env** file.
40-
#. If it is not on the production server, set ``CI_ENVIRONMENT`` to ``development``
41-
in **.env** file to take advantage of the debugging tools provided. See
42-
:ref:`setting-development-mode` for the detail.
42+
#. $indexPage
43+
If you don't want to include **index.php** in your site URIs, set ``$indexPage`` to ``''``.
44+
The setting will be used when the framework generates your site URIs.
45+
46+
.. note:: You may need to configure your web server to access your site with a URL
47+
that does not contain **index.php**. See :ref:`CodeIgniter URLs <urls-remove-index-php>`.
48+
49+
Configure Database Connection Settings
50+
======================================
51+
52+
If you intend to use a database, open the
53+
**app/Config/Database.php** file with a text editor and set your
54+
database settings. Alternately, these could be set in your **.env** file.
55+
56+
Set to Development Mode
57+
=======================
58+
59+
If it is not on the production server, set ``CI_ENVIRONMENT`` to ``development``
60+
in **.env** file to take advantage of the debugging tools provided. See
61+
:ref:`setting-development-mode` for the detail.
62+
63+
.. important:: In production environments, you should disable error display and
64+
any other development-only functionality. In CodeIgniter, this can be done
65+
by setting the environment to "production". By default, the application will
66+
run using the "production" environment. See also :ref:`environment-constant`.
4367

44-
.. important:: In production environments, you should disable error display and
45-
any other development-only functionality. In CodeIgniter, this can be done
46-
by setting the environment to "production". By default, the application will
47-
run using the "production" environment. See also :ref:`environment-constant`.
68+
Set Writable Folder Permission
69+
==============================
4870

49-
.. note:: If you will be running your site using a web server (e.g., Apache or Nginx),
50-
you will need to modify the permissions for the **writable** folder inside
51-
your project, so that it is writable by the user or account used by your
52-
web server.
71+
If you will be running your site using a web server (e.g., Apache or nginx),
72+
you will need to modify the permissions for the **writable** folder inside
73+
your project, so that it is writable by the user or account used by your
74+
web server.
5375

5476
************************
5577
Local Development Server
@@ -355,10 +377,10 @@ Setting Environment
355377
See :ref:`Handling Multiple Environments <environment-apache>`.
356378

357379
******************
358-
Hosting with Nginx
380+
Hosting with nginx
359381
******************
360382

361-
Nginx is the second most widely used HTTP server for web hosting.
383+
nginx is the second most widely used HTTP server for web hosting.
362384
Here you can find an example configuration using PHP 8.1 FPM (unix sockets) under Ubuntu Server.
363385

364386
default.conf

user_guide_src/source/tutorial/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Running Development Server
9292
==========================
9393

9494
With that out of the way it's time to view your application in a browser. You can
95-
serve it through any server of your choice, Apache, Nginx, etc, but CodeIgniter
95+
serve it through any server of your choice, Apache, nginx, etc, but CodeIgniter
9696
comes with a simple command that takes advantage of PHP's built-in server to get
9797
you up and running fast on your development machines. Type the following on the
9898
command line from the root of your project:

0 commit comments

Comments
 (0)