You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+38-11
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,27 @@ A clean and responsive interface for Zend OPcache information, showing statistic
4
4
5
5
This interface uses ReactJS and Axios and is for modern browsers and requires a minimum of PHP 7.1.
6
6
7
-
[](https://flattr.com/submit/auto?user_id=acollington&url=https://github.com/amnuts/opcache-gui&title=opcache-gui&language=&tags=github&category=software)
8
-
If you like this software or find it helpful then maybe you'll consider supporting my efforts in some way by [signing up to Flattr and leaving a micro-donation](https://flattr.com/@acollington).
7
+
# License
8
+
9
+
MIT: http://acollington.mit-license.org/
10
+
11
+
# Sponsoring this work
12
+
13
+
If you're able and would like to sponsor this work in some way, then feel free to do so through the [GitHub Sponsorship](https://github.com/sponsors/amnuts) page.
14
+
15
+
Alternatively, if you'd just like to give me a [shout-out on Twitter](https://twitter.com/acollington) to say you use it, that'd be awesome, too! (Any one else miss postcardware?)
16
+
17
+
# Using the opcache-gui
9
18
10
-
### Using the opcache-gui
19
+
##Installing
11
20
12
21
There are two ways to getting started using this gui:
13
22
14
-
####Copy/clone this repo
23
+
### Copy/clone this repo
15
24
16
25
The easiest way to start using the opcache-gui is to clone this repo, or simply copy/paste/download the `index.php` file to a location which your web server can load. Then point your browser to that location, such as `https://www.example.com/opcache/index.php`.
17
26
18
-
####Install via composer
27
+
### Install via composer
19
28
20
29
You can include the files with [Composer](https://getcomposer.org/) by running the command `composer require amnuts/opcache-gui`.
Basically, there are plenty of ways to get the interface up and running - pick whichever suits your needs.
60
69
61
-
###Configuration
70
+
## Configuration
62
71
63
72
The default configuration for the interface looks like this:
64
73
@@ -94,7 +103,7 @@ $opcache = (new Service([
94
103
]))->handle();
95
104
```
96
105
97
-
###Changing the look
106
+
## Changing the look
98
107
99
108
The interface has been split up to allow you to easily change the colours of the gui, or even the core components, should you wish.
100
109
@@ -115,6 +124,8 @@ The build process will create a compiled css file at `build/interface.css` and t
115
124
116
125
The core PHP template used in the build process, and that acts to pass various bits of data to the ReactJS side of things, is located at `build/template.phps`. If you wanted to update the version of ReactJS used, or how the wrapper html is structured, then this would be the file you'd want to update.
117
126
127
+
## The interface
128
+
118
129
### Overview
119
130
120
131
The overview will show you all the core information. From here you'll be able to see what host and platform you're running on, what version of OPcache you're using, when it was last reset, the functions and directives available (with links to the php.net manual), and all the statistics associated with the OPcache (number of hits, memory used, free and wasted memory, and more).
@@ -159,7 +170,13 @@ When the real-time updates are active, the interface will automatically update a
159
170
160
171
Also, if you choose to invalidate any files or reset the cache it will do this without reloading the page, so the search term you've entered, or the page to which you've navigated do not get reset. If the real-time update is not on then the page will reload on any invalidation usage.
161
172
162
-
## Releases
173
+
# Releases
174
+
175
+
**Version 3.3.1**\
176
+
Just a few minor tweaks:
177
+
* Added more of an explanation to the JIT value
178
+
* Replaced date functions with \DateTime and related classes
179
+
* Updated README with troubleshooting and sponsorship info (and refined header levels)
163
180
164
181
**Version 3.3.0**\
165
182
Mostly added JIT information for PHP 8:
@@ -250,7 +267,7 @@ Releases of the GUI are available at:
250
267
251
268
https://github.com/amnuts/opcache-gui/releases/
252
269
253
-
###Making is compatible with PHP 7.0
270
+
# Making is compatible with PHP 7.0
254
271
255
272
The script requires PHP 7.1 or above. I'm not tempted to downgrade the code to make it compatible with version 7.0, and hopefully most people would have upgraded by now. But I really do appreciate that sometimes people just don't have the ability to change the version of PHP they use because it's out of their control. So if you're one of the unlucky ones, you can make the following changes to `index.php` (or `Service.php` and run the build script). For the lines:
256
273
@@ -264,6 +281,16 @@ public function resetCache(?string $file = null): bool
264
281
265
282
It'll just be a case of removing the `?` from each of the params.
266
283
267
-
# License
284
+
# Troubleshooting
268
285
269
-
MIT: http://acollington.mit-license.org/
286
+
## Use of PHP-FPM
287
+
288
+
A number of people have questioned whether the opcache-gui is working on their instance of PHP-FPM, as the files shown don't appear to be everything that's cached, and that's different to what Apache might show.
289
+
290
+
Essentially, that's expected behaviour. And thanks to a great comment from contributor [Michalng](https://github.com/amnuts/opcache-gui/issues/78#issuecomment-1008015099), this explanation should cover the difference:
291
+
292
+
> The interface can only show what it knows about the OPcache usage of its own OPcache instance, hence when it's accessed through Apache with mod_php, then it can only see the OPcache usage of that Apache webserver OPcache instance. When it's accessed with classic CGI, it can only see itself being cached as a new PHP and OPcache instance is created, in which case OPcache itself often doesn't make sense.
293
+
>
294
+
> To be able to monitor and manage the OPcache for all web applications, all need to use the same FastCGI, i.e. PHP-FPM instance.
295
+
>
296
+
> In case of Apache, one then often needs to actively configure it to not use it's internal mod_php but send PHP handler requests to the shared PHP-FPM server via mod_proxy_fcgi, which also requires using the event MPM. That is generally seen as the preferred setup nowadays, especially for high traffic websites. This is because every single incoming request with MPM prefork + mod_php creates an own child process taking additional time and memory, while with event MPM and dedicated PHP-FPM server a (usually) already waiting handler thread is used on Apache and on PHP end, consuming nearly no additional memory or time for process spawning.
0 commit comments