--home/root (sharehosting root directory)
|__ public_html (or your domain root folder)
| |__assets
| |__ index.php
| |__ .htaccess
|
|__ codeigniter (create a folder with any name you like)
|__ app(all the files and folder in app folder)
|__ system
|__ writable
|__ .env (dot env file here)
现在您需要更改一些值来启动并运行您的 codeigniter4 项目
In public_html folder index.php文件更改$pathsPath = FCPATH . '../app/Config/Paths.php'; to $pathsPath = FCPATH . '../codeigniter/app/Config/Paths.php';
In app/Config folder App.php文件更改$baseURL = 'http://192.168.0.111/'; to $baseURL = 'http://yourdomain.com/';.
进行此更改后,您的网站将启动并运行。
要在子域中部署,如果您的子域根文件夹位于 public_html 中,那么您应该更改$pathsPath = FCPATH . '../app/Config/Paths.php'; to $pathsPath = FCPATH . '../../codeigniter/app/Config/Paths.php'; in public_html/yourdomain folder index.php文件,目录结构保持不变。重要的:公用文件夹内容应放置在您的子域文件夹中。