Home  >  Article  >  Backend Development  >  How to deploy PHP distributed

How to deploy PHP distributed

王林
王林Original
2019-10-11 17:45:506027browse

How to deploy PHP distributed

Distributed deployment steps based on ThinkPHP

ThinkPHP supports binding domain names to a module, such as binding u. lingyun.net to the User module under Application, and bind bbs.lingyun.net to the Forum module. Using this feature we can implement distributed deployment. The following are the main steps:

1. Open the Session storage database

Add the following lines in Common/Conf/config.php:

//Session设置
'SESSION_OPTIONS'    => array(    
        'expire' => 864000,        
        'type'   => 'Db',    
),

2. Assume you have AB The IP address of the two cloud servers A is 1.2.3.4, and the IP address of B is 5.6.7.8. In the domain name resolution, bbs.lingyun.net is resolved to 1.2.3.4, and u.lingyun.net is resolved to 5.6.7.8.

3. Deploy the same code in two servers AB

After the above three steps, the simplest distribution is deployment, which is equivalent to server A mainly responsible for forum-related access, server B Mainly responsible for accessing user pages.

Recommended tutorial: PHP video tutorial

The above is the detailed content of How to deploy PHP distributed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn