Thinkphp can run multi-site apps in one directory, and each app needs to configure its own portal files separately. Thinkphp default applies To application, if you want to add an app named Application2, simply copy the application under the root and rename it to Application2, Copy the index.php under the root directory as application.php and modify the application.php
1 //Application Portal File2 3 //Detect PHP environment4 if(Version_compare(php_version, ' 5.3.0 ', ' < ') die(' Require PHP > 5.3.0! '));5 6 //Open Debug mode suggest the development phase to open the deployment phase comment or set to False7 Define(' App_debug ',True);8 9 //defining the App catalogTen Define(' App_path ', './application2/')); One A //Introducing the thinkphp entry file - require'./thinkphp/thinkphp.php ';
Then enter Localhost/application2 to access the Application2 app
Typically 3.2 does not need to use multi-application mode, because in most cases, we can solve the application expansion requirements through multi-modular and multi-entry design. As an example of the default application application, simply copy the home in the application directory to admin and change the namespace within the indexController.class.php within the Admin/controller
1 <? php 2 namespace Admin \controller; 3 Think\controller; 4 class indexcontroller extends 5 public function index () { 6 echo "Admin" 7 8 }
Enter Localhost/admin to access the admin module
thinkphp Multi-application/multi-module configuration