You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your project folder is not a subfolder of the Apache document root, then your
148
-
<VirtualHost> element may need a nested <Directory> element to grant the web server access to the files.
148
+
``<VirtualHost>`` element may need a nested ``<Directory>`` element to grant the web server access to the files.
149
149
150
-
With mod_userdir (shared hosts)
150
+
With mod_userdir (Shared Hosts)
151
151
--------------------------------
152
152
153
153
A common practice in shared hosting environments is to use the Apache module "mod_userdir" to enable per-user Virtual Hosts automatically. Additional configuration is required to allow CodeIgniter4 to be run from these per-user directories.
154
154
155
155
The following assumes that the server is already configured for mod_userdir. A guide to enabling this module is available `in the Apache documentation <https://httpd.apache.org/docs/2.4/howto/public_html.html>`_.
156
156
157
-
Because CodeIgniter4 expects the server to find the framework front controller at ``/public/index.php`` by default, you must specify this location as an alternative to search for the request (even if CodeIgniter4 is installed within the per-user web directory).
157
+
Because CodeIgniter4 expects the server to find the framework front controller at **public/index.php** by default, you must specify this location as an alternative to search for the request (even if CodeIgniter4 is installed within the per-user web directory).
158
158
159
-
The default user web directory ``~/public_html`` is specified by the ``UserDir`` directive, typically in ``/apache2/mods-available/userdir.conf`` or ``/apache2/conf/extra/httpd-userdir.conf``::
159
+
The default user web directory **~/public_html** is specified by the ``UserDir`` directive, typically in **apache2/mods-available/userdir.conf** or **apache2/conf/extra/httpd-userdir.conf**::
160
160
161
161
UserDir public_html
162
162
163
163
So you will need to configure Apache to look for CodeIgniter's public directory first before trying to serve the default::
164
164
165
165
UserDir "public_html/public" "public_html"
166
166
167
-
Be sure to specify options and permissions for the CodeIgniter public directory as well. A ``userdir.conf`` might look like::
167
+
Be sure to specify options and permissions for the CodeIgniter public directory as well. A **userdir.conf** might look like::
168
168
169
169
<IfModule mod_userdir.c>
170
170
UserDir "public_html/public" "public_html"
@@ -221,7 +221,7 @@ See :ref:`Handling Multiple Environments <environment-apache>`.
221
221
Testing
222
222
-------
223
223
224
-
With the above configuration, your webapp would be accessed with the URL ``http://myproject.local`` in your browser.
224
+
With the above configuration, your webapp would be accessed with the URL **http://myproject.local/** in your browser.
225
225
226
226
Apache needs to be restarted whenever you change its configuration.
227
227
@@ -279,7 +279,7 @@ Bootstrapping the App
279
279
In some scenarios you will want to load the framework without actually running the whole
280
280
application. This is particularly useful for unit testing your project, but may also be
281
281
handy for using third-party tools to analyze and modify your code. The framework comes
282
-
with a separate bootstrap script specifically for this scenario: ``system/Test/bootstrap.php``.
282
+
with a separate bootstrap script specifically for this scenario: **system/Test/bootstrap.php**.
283
283
284
284
Most of the paths to your project are defined during the bootstrap process. You may use
285
285
pre-defined constants to override these, but when using the defaults be sure that your
0 commit comments