当前位置:网站首页>Simple personal summary of tp6 multi application deployment -- Part I [original]
Simple personal summary of tp6 multi application deployment -- Part I [original]
2022-06-26 04:20:00 【Telkobe】
Many novice friends tp6 The use of multi - application mode is very annoying , Do not know how to start , The deployment process is also not smooth , This article is for me personally tp6 A simple record of multi application deployment , Hope you can give some help to those who don't know , If you have any questions, please correct , I'll revise it as soon as possible .
I won't talk about the installation process , direct composer install , It is assumed that you have already installed it locally tp6. Let's get to the point .
tp6 There are probably two ways to deploy multiple application patterns , One is single entry automatic multi application mode , The second is that an entry file corresponds to an application , Let's start with the first deployment mode , Single entry automatic multi application mode .
Here, we need to mention that we need to use the multi application mode optical installation tp6 The main frame is not good , You also need to install the multi application mode extension .
composer require topthink/think-multi-app
After installing the extension, you can start to configure . First, to simplify url, I will use domain name binding to access various applications , If you don't know how to use domain name binding, you can go to the manual ,( The manual says : If your multiple applications use multiple subdomains or separate domain names to access , You can config/app.php Define the binding between the domain name and the application in the configuration file .)
'domain_bind' => [
'blog' => 'blog', // blog The subdomain name is bound to blog application
'shop.tp.com' => 'shop', // Full domain name binding
'*' => 'home', // The second level universal domain name is bound to home application
],
Because domain name binding is involved, two or more virtual domain names need to be set locally as standby , I only build two applications , Foreground and background applications , So we built two virtual domain names .
After the preparation work is finished, now start to configure the server , I am using apache, So the configuration is as follows , Both domains point to index.php This entry file .
open config Under directory app.php Configure domain name binding , Bind the primary domain name to index application ,admin The subdomain name is bound to admin application
stay app New under the directory index,admin Two documents , And copy the original controller Folders are under the two newly created application files , And modify each controller Namespace of the file , The original controller Delete folder . Copy route Folder to two application folders for standby , Finally, the directory structure is as follows .
Now we can start multi application mode access , I index application index Method returns the application name .
Browser access www.tp6.cn, Results the correct
Then we visit admin,admin The controller also returns the application name .
It can be seen that the result is also correct .
It shows that our single entry automatic multi application mode is basically deployed , We can add routing access to the application . I am in the application of index Create a new controller named ceshi Methods , Then set up routing access to it . such as index This is the case in the application controller .
And then in app/index/route/route.php Set the route in the file
Now we can use it www.tp6.cn/ceshi Visit this address ceshi The method
The same goes for background applications .
If the access prompt :No input file specified. open public Folder modification htaccess file , stay index.php Add a question mark after it
PS: Other common extension installations
composer require topthink/think-view // Template rendering
composer require topthink/think-captcha // Verification Code
边栏推荐
- 1064 (42000) error occurred when installing MySQL and modifying root password
- What should I do if the 51 SCM board cannot find the device in keil
- 【QT】对话框dialog
- Video label forbids downloading. The test is valid. Hide button. The test is valid at three points
- 线程同步之互斥量(互斥锁)
- Double buffer technology asynchronous log system
- In the matter of getting customers at sea, how can advertisers play besides digital advertising?
- The stc-isp burning program for 51 single chip microcomputer always shows that "the target single chip microcomputer is being detected..." the cold start board does not respond
- NFT creation and binding of BSC and HT chains
- Zeromq from getting started to mastering
猜你喜欢
Part 4: drawing quadrilateral
What if the serial port fails to open when the SCM uses stc-isp to download software?
pip 批量完全卸载包
College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
Parse JSON interface and insert it into the database in batch
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
Oracle technology sharing Oracle 19.14 upgrade 19.15
Install SVN in Pagoda and build SVN version Library
What preparation should I make before learning SCM?
Threejs special sky box materials, five kinds of sky box materials are downloaded for free
随机推荐
Gateway can not connect to tcp://127.0.0.1: Connection refused
The stc-isp burning program for 51 single chip microcomputer always shows that "the target single chip microcomputer is being detected..." the cold start board does not respond
BSC 及HT 等链的NFT 创造及绑定图片教程
Detailed explanation of widget construction process of fluent
How do wechat applets delay? Timing? Execute a piece of code after? (kengji)
CTF crypto (I) some simple encoding and encryption
Getter actual combat geTx tool class encapsulation -getutils
Lua语法讲解
Use soapUI to access the corresponding ESB project
Double buffer technology asynchronous log system
Threejs专用天空盒素材,五种天空盒素材免费下载
Analysis report on the development trend and operation status of China's environmental monitoring instrument industry from 2022 to 2028
ctf [RoarCTF 2019]easy_ calc
NPM installation tutorial
List of provinces, cities and counties in China
Threejs special sky box materials, five kinds of sky box materials are downloaded for free
A brain map to summarize the needs analysis (a supplement to the actual situation at work)
Laravel access error could not be opened
How does virtual box virtual machine software accelerate the network speed in the virtual system?
Analysis report on development trend and market demand of global and Chinese molecular diagnostics industry from 2022 to 2028