I won’t talk about TP installation, but start directly from the completion of the installation.
- Install the multi-app mode extension
think-multi-app
composer require topthink/think-multi-app
-
Delete the folder in the
app
directory (TP determines single application mode or multi-application mode based on whether there is this folder).controller
-
Create app
// 创建 admin 应用
php think build admin
// 创建 api 应用
php think build api
Note: Make surevendor/services.php
that the file contains the following two items
Result verification:
www.xxx.com /admin (pay attention to the pseudo-static configuration, if not configured, you need to use www.xxx.com/index.php/admin)
www.xxx.com/api (pay attention to the pseudo-static configuration, if not configured Need to use www.xxx.com/index.php/api)
The multi-application configuration is completed here, and other content will be added later