Zend global variable in extension persisting on multiple requests

As explained in the header, I want to maintain information on requests from multiple clients. Let me give you a simple example to explain what I want. This example is intended only to illustrate my question, and not for the purpose of the message.

Example: I want to calculate the total number of requests that the server has had so far from all clients for different php scripts. I mean TOTAL the number of requests that come from MULTIPLE of different clients for MULTIPLE DIFFERENT pages. Now I will have an extension that reads this global counter and returns it for the PHP programmer.

The super global variables that zend provides are persistent for only a few requests from the same client. Does anyone know how and where to store a variable and how to retrieve it?

+4
source share
1 answer

The only way is to use some form of Inter-process communication . For example, you can use shared memory (but you will need to synchronize access to it).

Remember that the most common way to run PHP is without threading — multiple processes, one process serving only one client at a time. The reason is that PHP is much faster in this configuration.

+1
source

All Articles