简体   繁体   English

两台主机上的php应用程序

[英]php application on two hosts

I have my php-mysql-oracle application hosted on two linux machines. 我在两台Linux机器上托管了php-mysql-oracle应用程序。 Of late, I've been seeing some issues with my application intermittently. 最近,我断断续续地看到一些应用程序问题。 The $_SESSION variables are sometime populated, sometimes blank. $_SESSION变量有时被填充,有时为空白。 My code also behaves weird. 我的代码也表现得很奇怪。 Sometimes a function works and sometimes it doesn't. 有时函数起作用,有时却不起作用。 I'm not able to replicate the issue correctly. 我无法正确复制该问题。

My assumption is $_SESSION and $_POST are getting mixed up somehow between the session. 我的假设是$_SESSION$_POST在会话之间有些混乱。 Is it really possible for such thing to happen. 这样的事情真的有可能发生吗? I dont have session and post variables saved in database. 我没有会话和发布变量保存在数据库中。

Are you running on a load balancer? 您是否在负载均衡器上运行? If so, $_SESSION data is being saved to disk on one of the machines on the load balancer. 如果是这样, $_SESSION数据将保存到负载均衡器上一台计算机上的磁盘上。 Then, when the load balancer switches you to the other machine, the $_SESSION data no longer exists, since the session file on disk doesn't exist on that machine. 然后,当负载平衡器将您切换到另一台计算机时, $_SESSION数据不再存在,因为磁盘上的会话文件在该计算机上不存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM