🆙 Add also iss setup for opcache 🆙

This commit is contained in:
Remco
2025-09-21 13:28:37 +02:00
parent 1f8eab29b2
commit 44b9711ff7
+27 -7
View File
@@ -1,14 +1,10 @@
Hier is de handleiding aangevuld met de stappen voor het instellen van de `opcache.file_cache` directive, wat een extra prestatieverbetering biedt.
-----
Here is a step-by-step tutorial in English on how to enable OPcache.
I will add a tutorial for setting up OPcache on IIS.
-----
### Step 1: Install the OPcache PHP Extension
First, you need to install the OPcache module for your specific PHP version. The package name is typically `php-opcache`, but you must specify the exact version.
First, you need to install the OPcache module for your specific PHP version. The package name is typically `php-opcache`, but it's a virtual package. You must specify the exact version.
1. **Check your PHP version:**
`php -v`
@@ -103,4 +99,28 @@ To confirm that OPcache is working, create a PHP info file in your web root.
Navigate to `http://your_domain.com/info.php`.
3. **Check the OPcache section:**
Search for **"Zend OPcache"**. The "Opcode Caching" status should be **"Up and Running"**. You will also see the configuration settings you just applied, including the path to the file cache.
Search for **"Zend OPcache"**. The "Opcode Caching" status should be **"Up and Running"**. You will also see the configuration settings you just applied, including the path to the file cache.
-----
### OPcache on IIS (Internet Information Services) 🌐
You can also use OPcache on a Windows Server with **IIS**. The configuration is similar to Linux, but with a few key differences.
1. **Find the `php.ini` file for IIS**:
The file is typically located in the PHP installation folder, such as `C:\Program Files\PHP\v8.3\php.ini`.
2. **Configure `opcache.file_cache`**:
In your `php.ini`, set the file cache path using a Windows-style path.
```ini
opcache.file_cache="C:\inetpub\temp\opcache"
```
You may also need to set `opcache.mmap_base` on Windows to prevent memory issues with many simultaneous requests.
3. **Create the cache directory**:
Create the folder and ensure the IIS user (e.g., `IIS_IUSRS` or the AppPool user) has write permissions.
4. **Restart IIS**:
Restart IIS to apply the changes. You can do this via the command line with `iisreset` or by using the IIS Manager.