thinkphp - When multiple users access a php program, there is no conflict between them. What is the principle?
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 13:09:10
0
3
590

For example, there is a class in the thinkphp program, which has an attribute to obtain the user's referrer

 if($_SERVER['HTTP_REFERER']==null){
            $visitor_info.='&referrer='.'empty';
        }else{
            $visitor_info.='&referrer='.$_SERVER['HTTP_REFERER'];
        }
        $this->visitor_info=$visitor_info; //An attribute is to obtain the user's referrer

When multiple users visit at the same time,each user has a corresponding $this->visitor_info that does not conflict, right?

Excuse me, there is no conflict in concurrent access. What is the principle behind it? ?

When each user accesses, will an area be allocated in the memory to save the corresponding reference? ?

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
为情所困

Generally speaking, when a user establishes a connection access, the server will open a new process to serve the request. In this process, the PHP interpreter will read the contents of the PHP file and instantiate an object. This object will have a Reference, when the request ends, all data is recycled, and the reference no longer exists.

PHPzhong

That is, when each user accesses, the program enters the memory one by one and is processed by the CPU one by one. This should be related to CPU mechanism and memory-related knowledge. It's not a PHP problem. After a program is executed, there must be a result. Apache will return it after getting the result.

我想大声告诉你

Because php is in multi-process mode. . When accessing, each user is an independent process space

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template