How to deploy PHP distributed

王林
Release: 2023-02-26 11:22:01
Original
5993 people have browsed it

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',    
),
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!