---
title: "How to Add Custom PHP Settings and Apache/Nginx Directives in ISPConfig"
description: "Set per-site PHP values such as timezone, upload size and OPcache, and add custom Apache or nginx directives, from a website's Options tab in ISPConfig."
url: "https://docs.noiz.ie/ispconfig/how-to-add-custom-php-settings-and-apachenginx-directives-in-ispconfig/"
section: "ISPConfig"
categories:
  - "Control Panels > ISPConfig > Sites & Domains"
last_reviewed: "27 July 2026, against the ISPConfig release Noiz runs"
---

# How to Add Custom PHP Settings and Apache/Nginx Directives in ISPConfig

ISPConfig can apply advanced per-site configuration from the control panel instead of the shell: custom PHP settings, and custom Apache or nginx directives. This is particularly useful for developers who want to optimise performance, tighten security, or satisfy a specific application requirement. This guide walks you through adjusting PHP settings, such as changing the timezone, increasing the maximum upload file size, and disabling OPcache, along with adding custom Apache or nginx directives. Every change is applied to a single website, so it stays isolated from the other sites on the server.

All of these settings live in the **Options** tab of a website. Access to that tab is deliberately restricted, because the fields on it are security sensitive and can reach beyond the site they belong to. ISPConfig shows the Options tab to the server administrator, and to a reseller only where the administrator has enabled **Reseller can use the option-tab for websites**. An ordinary client login does not see the tab at all. If you hold a client account on Noiz hosting, send the exact settings you want to Noiz support and Noiz will apply them to your site.

**Last reviewed:** 27 July 2026, against the ISPConfig release Noiz runs. This guide is written for Noiz hosting and is kept current against ISPConfig. It complements, and does not replace, the official ISPConfig documentation linked below.

### Official Documentation Reference

- [ISPConfig 3.3 documentation portal](https://www.ispconfig.org/documentation/) (the successor to the ISPConfig 3.1 Manual).
- [PHP: list of supported timezones](https://www.php.net/manual/en/timezones.php).
- [PHP: description of core php.ini directives](https://www.php.net/manual/en/ini.core.php).

## Prerequisites

- Login credentials for the ISPConfig control panel as the server administrator, or as a reseller on a server where the administrator has enabled the Options tab for resellers.
- Access to the specific website domain within ISPConfig.
- Basic familiarity with PHP directives and web server configuration (for example, php.ini syntax).
- A compatible PHP mode. PHP-FPM, FastCGI, CGI, and SuPHP all support custom php.ini overrides. Mod-PHP does not, so under Mod-PHP those directives belong in the Apache section instead.

Changes may take a minute or two to propagate, because ISPConfig regenerates the affected configuration files automatically. Where possible, test modifications on a staging site first so you do not disrupt a live site.

## Step 1: Log In to the ISPConfig Control Panel

1. Navigate to the ISPConfig login URL supplied by Noiz for your account (typically on port `8080`, for example `https://your-server:8080`).
2. Enter your username and password.
3. Once logged in, you will see the dashboard with tabs for Sites, Email, DNS, and more.

## Step 2: Open the Website Options Tab

1. Click the **Sites** tab in the top menu.
2. Under **Websites** in the left-hand menu, select **Website**.
3. In the list of websites, click the domain you want to configure.
4. Switch to the **Options** tab. If it is not there, your login does not have access to it, so see the note at the top of this guide.

The Options tab groups the fields you will use here:

- The PHP-FPM process manager fields, which control how many PHP processes the site may run.
- **PHP open\_basedir**, which limits the directories PHP may read and write for this site.
- A text area for **Custom php.ini settings**.
- A text area for **Apache Directives** (Apache only) or **nginx Directives** (nginx only).

<!-- IMG: ispconfig-website-options-tab | alt: The Options tab of a website in the ISPConfig control panel, showing the PHP-FPM settings, the Custom php.ini settings text area, and the web server Directives text area -->

## Step 3: Configure Custom PHP Settings

The **Custom php.ini settings** field lets you override the global PHP configuration on a per-site basis. Enter one directive per line using standard php.ini syntax (for example, `key = value`). These overrides apply under PHP-FPM, FastCGI, CGI, and SuPHP.

Where the server administrator has defined Directive Snippets under **System > Directive Snippets**, they are listed by name beside the text area. Click a name and the snippet's contents are inserted at the cursor position. The same applies to the Apache and nginx directive fields covered in Step 4.

### Changing the PHP Timezone

To set a specific timezone (for accurate date handling in applications such as WordPress or custom scripts):

1. In the Custom php.ini settings text area, add:

```
date.timezone = Africa/Johannesburg
```

Replace `Africa/Johannesburg` with the timezone you need (for example, `Europe/Dublin`). See the [PHP timezone list](https://www.php.net/manual/en/timezones.php) for valid values.

2. Save the changes. Under PHP-FPM, ISPConfig writes the setting into the site's own PHP-FPM pool configuration; under Fast-CGI, CGI or SuPHP it writes a per-site php.ini instead.

This ensures functions such as `date()` use the correct timezone, preventing errors in logging or scheduling.

### Increasing the Maximum PHP Upload Size

For applications that need to accept larger file uploads (for example, media-heavy CMS platforms):

1. Add the following lines to the Custom php.ini settings:

```
upload_max_filesize = 64M
post_max_size = 64M
```

Adjust the values (for example, `128M`) to suit your needs, but stay within your hosting plan's resource limits. Note that `post_max_size` must be at least as large as `upload_max_filesize`, or the upload will still be rejected.

2. Optionally, allow more time for large uploads to complete:

```
max_execution_time = 300
max_input_time = 300
```

3. Save, then verify by uploading a test file or checking `phpinfo()` output.

These settings override the server defaults, enabling smoother file handling in forms or admin panels.

### Disabling OPcache

OPcache improves performance by caching compiled PHP bytecode, but it can get in the way during active development, or with certain plugins that write PHP at runtime. To disable it:

1. Add this line to the Custom php.ini settings:

```
opcache.enable = 0
```

2. Save the changes. This stops opcode caching for the site, and you can re-enable it later by setting the value back to `1`.

Verify by checking `phpinfo()` output, where "Opcode Caching" is then listed as "Disabled". Leave OPcache on for production sites once you have finished debugging, because disabling it noticeably increases PHP execution time.

## Step 4: Add Custom Apache or nginx Directives

For web-server-specific tweaks, such as redirects, security headers, or proxy configuration, use the **Apache Directives** field (Apache only) or the **nginx Directives** field (nginx only). Enter one directive per line, following Apache or nginx syntax. Which field appears depends on the web server your site runs, so you will see one or the other, not both. Whatever you enter is written into the site's virtual host container.

### Adding Apache Directives

Common examples include URL redirects and header modifications:

1. For a permanent redirect to a canonical hostname:

```
Redirect 301 / https://www.yourdomain.com/
```

2. To set security headers:

```
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
```

3. Save. ISPConfig inserts these into the site's virtual host configuration.

### Adding nginx Directives

On nginx, equivalent directives apply:

1. For a location-based redirect:

```
location /old-path {
    return 301 /new-path;
}
```

2. To enable gzip compression:

```
gzip on;
gzip_types text/plain text/css application/javascript;
```

3. Save. These are added to the site's nginx vhost block.

One nginx-specific trap is worth knowing before you paste anything in. If you declare a `location` block that the generated vhost already uses, such as `location ~ /\. {}` or `location @php {}`, ISPConfig replaces the original block with yours rather than combining them, which quietly removes the configuration the site depended on. To keep the original and add to it, put the string `##merge##` to the right of the location line:

```
location @php { ##merge##
    fastcgi_read_timeout 300;
}
```

Directives are powerful, but a mistake can break site functionality or produce a 500 error, so test each change thoroughly.

## Step 5: Adjust PHP-FPM Performance Settings (Optional)

If your site uses PHP-FPM, the same Options tab carries the pool tuning fields. ISPConfig names each one after the PHP-FPM directive it writes, and shows or hides fields depending on which process manager you select:

- **PHP-FPM Process Manager**: `static`, `dynamic`, or `ondemand`. ISPConfig recommends `ondemand` for minimal resource usage, because no child processes are started until a request arrives. `dynamic` trades idle memory for responsiveness under steady traffic.
- **PHP-FPM pm.max\_children**: the ceiling on simultaneous PHP processes, and so on the number of requests the site can serve at once. Set it (for example, 40) from your traffic and your plan's memory allowance.
- **PHP-FPM pm.process\_idle\_timeout**: seconds before an idle process is killed. This one applies to `ondemand` only, and defaults to 10 seconds.
- **PHP-FPM pm.start\_servers**, **PHP-FPM pm.min\_spare\_servers** and **PHP-FPM pm.max\_spare\_servers**: these appear for `dynamic` only. ISPConfig refuses the form unless `pm.max_children >= pm.max_spare_servers >= pm.start_servers >= pm.min_spare_servers > 0`.
- **PHP-FPM pm.max\_requests**: how many requests a child handles before it is respawned, which is the usual way to work around a memory leak in a third-party library. `0` means never respawn.

Save to apply. These settings help you balance CPU and memory usage without affecting other sites on the server.

## Verification and Troubleshooting

- After saving, wait 1 to 2 minutes, then refresh your site.
- Create a temporary `phpinfo.php` file (`<?php phpinfo(); ?>`) in your document root to confirm the changes, then delete it afterwards for security.
- Check the site's own error log if something goes wrong. ISPConfig mounts it inside the website directory as `log/error.log`, so you can read it over SFTP or FTP. ISPConfig's Monitor module is the administrator's server-wide view of system and service logs, and does not carry per-site web logs.
- **Symptom**: a 500 error after saving directives. A syntax error in an Apache or nginx directive is the usual cause, so remove the last change you made and reapply it one line at a time.
- **Symptom**: a php.ini override has no effect. Confirm the site is running a PHP mode that honours custom php.ini (PHP-FPM, FastCGI, CGI, or SuPHP) rather than Mod-PHP. Under Mod-PHP the equivalent is `php_admin_value` or `php_flag` in the Apache Directives field, which in turn has no effect under any of the other modes.
- **Symptom**: PHP reports a file access or open\_basedir error after your change. The **PHP open\_basedir** field on the same Options tab restricts which directories PHP may touch. Add the extra path there, separated from the existing entries by a colon, or enter the string `none` to switch the restriction off. Clearing the field does not disable it.
- **Symptom**: a later change to the server-wide PHP configuration does not seem to reach the site. Your Custom php.ini settings are applied on top of the server's own PHP configuration, and ISPConfig carries server-wide changes through to the site automatically, so the usual cause is a line in Custom php.ini settings that sets the same directive. Remove or change that line if you want the server-wide value to apply.

If a change still does not apply, contact Noiz support with the details of your modification and Noiz will assist.

## Summary

Customising PHP settings and web server directives in ISPConfig lets you tailor your Noiz hosting environment precisely, per website. By following these steps you can adjust the timezone, raise upload limits, control OPcache, and add your own Apache or nginx rules, all from the control panel and all isolated from your other sites. For deeper configuration, consult the ISPConfig documentation linked above, and always keep security and performance in mind when making changes.

---
Source: https://docs.noiz.ie/ispconfig/how-to-add-custom-php-settings-and-apachenginx-directives-in-ispconfig/
