CodeIgniter§
要使用 Unit 运行使用 CodeIgniter Web 框架构建的应用
使用 PHP 语言模块安装 Unit。
下载 CodeIgniter 的 核心文件 并 构建 你的应用。在此,我们使用 基本应用模板,将其安装在 /path/to/app/。
运行以下命令,以便 Unit 可以访问 应用目录
# chown -R unit:unit /path/to/app/
有关更多详细信息,包括权限,请参阅 安全检查清单。
接下来,准备 CodeIgniter 配置以供 Unit 使用
{ "listeners": { "*:80": { "pass": "routes" } }, "routes": [ { "match": { "uri": "!/index.php" }, "action": { "share": "/path/to/app/public$uri", "fallback": { "pass": "applications/codeigniter" } } } ], "applications": { "codeigniter": { "type": "php", "root": "/path/to/app/public/", "script": "index.php" } } }
上传更新后的配置。假设上述 JSON 已添加到
config.json
# curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock http://localhost/config/
更新成功后,您的应用应可在侦听器的 IP 地址和端口上使用