obsidian/MyObsidianVault/WebDev/Devilbox/Install Devilbox + CodeIgniter.md

68 lines
1.2 KiB
Markdown
Raw Normal View History

2024-11-09 08:01:01 +01:00
Source:
[Setup CodeIgniter — Devilbox 1.0 documentation](https://devilbox.readthedocs.io/en/latest/examples/setup-codeigniter.html?highlight=CodeIgniter)
Prerequisites: Have correct docker compose installed:
```bash
sudo apt install docker-compose-v2
```
Download Devilbox
Remove unwanted hosts from docker-compose.yml file
copy env file to .env
Set TLD_SUFFIX=local
In /etc/hosts, add 127.0.01 with application URL:
127.0.0.1 verleihapp.local
Start docker container: sudo docker compose up -d
Enter Container: ./shell.sh
Install CodeIgniter4 and create htdocs link:
```bash
mkdir myproject
cd myproject
composer create-project codeigniter4/appstarter myprojectapp
2024-11-09 11:10:13 +01:00
ln -s myprojectapp/public htdocs
2024-11-09 08:01:01 +01:00
```
.env settings
```php
CI_ENVIRONMENT = development (instead of production)
app.baseURL = 'http://myproject.local'
database.default.hostname = myproject.local
database.default.database = myproject
database.default.username = root
database.default.password =
database.default.DBDriver = MySQLi
database.default.DBPrefix =
database.default.port = 3306
```
Access mysql from inside container
```bash
./shell.sh
mysql -h 127.0.0.1 -u root
CREATE DATABASE TEST_DB;
```
2024-11-09 11:10:13 +01:00
https://shield.codeigniter.com/getting_started/install/