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
Copy file name to clipboardExpand all lines: user_guide_src/source/installation/running.rst
+20-14Lines changed: 20 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
################
1
2
Running Your App
2
3
################
3
4
@@ -20,8 +21,9 @@ section of the User Guide to begin learning how to build dynamic PHP application
20
21
21
22
.. _initial-configuration:
22
23
24
+
*********************
23
25
Initial Configuration
24
-
=====================
26
+
*********************
25
27
26
28
#. Open the **app/Config/App.php** file with a text editor and
27
29
set your base URL to ``$baseURL``. If you need more flexibility, the baseURL may
@@ -49,11 +51,12 @@ Initial Configuration
49
51
your project, so that it is writable by the user or account used by your
50
52
web server.
51
53
54
+
************************
52
55
Local Development Server
53
-
========================
56
+
************************
54
57
55
58
CodeIgniter 4 comes with a local development server, leveraging PHP's built-in web server
56
-
with CodeIgniter routing. You can launch it, with the following command line
59
+
with CodeIgniter routing. You can launch it, with the following command line
57
60
in the main directory::
58
61
59
62
> php spark serve
@@ -83,8 +86,9 @@ The local development server can be customized with three command line options:
83
86
84
87
> php spark serve --php /usr/bin/php7.6.5.4
85
88
89
+
*******************
86
90
Hosting with Apache
87
-
===================
91
+
*******************
88
92
89
93
A CodeIgniter4 webapp is normally hosted on a web server.
90
94
Apache HTTP Server is the "standard" platform, and assumed in much of our documentation.
@@ -93,7 +97,7 @@ Apache is bundled with many platforms, but can also be downloaded in a bundle
93
97
with a database engine and PHP from `Bitnami <https://bitnami.com/stacks/infrastructure>`_.
94
98
95
99
.htaccess
96
-
---------
100
+
=========
97
101
98
102
The "mod_rewrite" module enables URLs without "index.php" in them, and is assumed
99
103
in our user guide.
@@ -113,12 +117,12 @@ in the ``AllowOverride`` setting::
113
117
</Directory>
114
118
115
119
Removing the index.php
116
-
----------------------
120
+
======================
117
121
118
122
See :ref:`CodeIgniter URLs <urls-remove-index-php-apache>`.
119
123
120
124
Virtual Hosting
121
-
---------------
125
+
===============
122
126
123
127
We recommend using "virtual hosting" to run your apps.
124
128
You can set up different aliases for each of the apps you work on,
@@ -148,7 +152,7 @@ If your project folder is not a subfolder of the Apache document root, then your
148
152
``<VirtualHost>`` element may need a nested ``<Directory>`` element to grant the web server access to the files.
149
153
150
154
With mod_userdir (Shared Hosts)
151
-
--------------------------------
155
+
===============================
152
156
153
157
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
158
@@ -214,25 +218,26 @@ Be sure to specify options and permissions for the CodeIgniter public directory
214
218
</IfModule>
215
219
216
220
Setting Environment
217
-
-------------------
221
+
===================
218
222
219
223
See :ref:`Handling Multiple Environments <environment-apache>`.
220
224
221
225
Testing
222
-
-------
226
+
=======
223
227
224
228
With the above configuration, your webapp would be accessed with the URL **http://myproject.local/** in your browser.
225
229
226
230
Apache needs to be restarted whenever you change its configuration.
227
231
232
+
******************
228
233
Hosting with Nginx
229
-
==================
234
+
******************
230
235
231
236
Nginx is the second most widely used HTTP server for web hosting.
232
237
Here you can find an example configuration using PHP 8.1 FPM (unix sockets) under Ubuntu Server.
233
238
234
239
default.conf
235
-
------------
240
+
============
236
241
237
242
This configuration enables URLs without "index.php" in them and using CodeIgniter's "404 - File Not Found" for URLs ending with ".php".
238
243
@@ -269,12 +274,13 @@ This configuration enables URLs without "index.php" in them and using CodeIgnite
269
274
}
270
275
271
276
Setting Environment
272
-
-------------------
277
+
===================
273
278
274
279
See :ref:`Handling Multiple Environments <environment-nginx>`.
275
280
281
+
*********************
276
282
Bootstrapping the App
277
-
=====================
283
+
*********************
278
284
279
285
In some scenarios you will want to load the framework without actually running the whole
280
286
application. This is particularly useful for unit testing your project, but may also be
0 commit comments