Title: Custom PHP Settings
Author: cyclonecode
Published: <strong>2019 年 2 月 25 日</strong>
Last modified: 2025 年 11 月 20 日

---

搜尋外掛

![](https://ps.w.org/custom-php-settings/assets/icon-256x256.png?rev=2053893)

# Custom PHP Settings

 由 [cyclonecode](https://profiles.wordpress.org/cyclonecode/) 開發

[下載](https://downloads.wordpress.org/plugin/custom-php-settings.2.4.1.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/custom-php-settings/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/custom-php-settings/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/custom-php-settings/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/custom-php-settings/#developers)

 [技術支援](https://wordpress.org/support/plugin/custom-php-settings/)

## 外掛說明

This plugin can be used to customize php settings for you WordPress installation.

The plugin will modify either the **.htaccess** file or **.user.ini** file in order
to change the current php settings directly from within the settings page.

Since the configuration file needs to be modified this file **must** be writable
for this plugin to work as expected.

#### Apache module

When PHP is running as an Apache module the **.htaccess** file will be used to set
customized settings; make sure so that this file **exists** and is **writable** 
by the webserver.

#### CGI/Fast-CGI

If instead PHP is running in CGI/Fast-CGI mode then a custom INI file will be used.
The name of this file depends on the value of **user_ini.filename** in the php configuration,
by default it is **.user.ini**.
 You can check the name of you custom INI file in
the **PHP Information** table. The custom INI file should be placed under the root
folder and **most** be **writable** by the webserver.

Notice that there is also a **User INI file cache TTL** value in the information
table, this value tells how long the custom INI file will be cached before it gets
reloaded.
 For instance, if this value is set to 300 then any changes to your custom
INI file will not be reflected for up to 5 minutes. The name for this setting in
the php configuration is **user_ini.cache_ttl**.

One important thing is to make sure that your `.user.ini` file is blocked by your
webserver. If you are running NGINX this can be done by adding:

    ```
    location ~ /\.user\.ini {
      deny all;
    }
    ```

to your server configuration. The same thing using Apache is done by adding the 
following to the configuration if not already done:

    ```
    <Files .user.ini>
    order allow,deny
    deny from all
    </Files>
    ```

#### Available Settings

The settings table will display all non-system php settings that can be customized
by the plugin. All modified settings will be displayed in red in this table.

Some settings might be displayed in red because they are changed somewhere else,
perhaps through a customized php.ini file, by WordPress itself, a plugin or in some
other way.
 For instance if you have enabled **WP_DEBUG** in your **wp-config.php**
file the **error_reporting** setting will turn red.

If you have questions or perhaps some idea on things that should be added you can
also try [slack](https://join.slack.com/t/cyclonecode/shared_invite/zt-6bdtbdab-n9QaMLM~exHP19zFDPN~AQ).

#### Multiple Configurations

The premium version adds support for creating multiple named configurations which
all can hold their own custom PHP settings.
 You will then be able to easily switch
between the different configurations entries applying them to you configuration 
file.

#### Environment Variables

In the premium version, when running PHP as an apache module and using an **.htaccess**
file for configuration, you are able
 to add custom environment variables. These
will be accessible by using the super global **$_SERVER** array. In order for this
to work you will need to have the mod_env module enabled in your apache setup.

#### Resources

A complete list of settings that can be modified can be found here: [List of php.ini directives](http://php.net/manual/en/ini.list.php)

Notice that directives marked as `PHP_INI_SYSTEM` can not be modified.

### Warning

Make sure you know how a value should be configured and what different settings 
do before changing anything.
 This is important since some settings might render
your page inaccessible, depending on what value you are using. A good example of
this is the **variables_order** configuration:

> Sets the order of the EGPCS (Environment, Get, Post, Cookie, and Server) variable
> parsing. For example, if variables_order is set to “SP” then PHP will create the
> superglobals $_SERVER and $_POST, but not create $_ENV, $_GET, and $_COOKIE. Setting
> to “” means no superglobals will be set.

If this value would be configured to **EPCS** then no **$_GET** superglobal would
be set which would make your page inaccessible.

Another example is setting the **post_max_size** to a very low value so that no 
form data is sent to the server, which in turn would result in that form data is
never saved.

If you by mistake changed some value and your site is now inaccessible you could
simply manually remove everything from between the plugin markers in your **.htaccess**
file:

    ```
    # BEGIN CUSTOM PHP SETTINGS PRO
    php_value variables_order EPCS  <-- Remove
    # END CUSTOM PHP SETTINGS PRO
    ```

If you are running PHP in CGI/Fast-CGI mode then instead remove everything between
the plugins markers in your **.user.ini** file:

    ```
    ; BEGIN CUSTOM PHP SETTINGS
    php_value variables_order EPCS  <-- Remove
    ; END CUSTOM PHP SETTINGS
    ```

### Support

If you run into any trouble, don’t hesitate to add a new topic under the support
section:
 [https://wordpress.org/support/plugin/custom-php-settings/](https://wordpress.org/support/plugin/custom-php-settings/)

You can also try contacting me on [slack](https://join.slack.com/t/cyclonecode/shared_invite/zt-6bdtbdab-n9QaMLM~exHP19zFDPN~AQ).

## 螢幕擷圖

[⌊Customize PHP settings from within WordPress administration.⌉⌊Customize PHP settings
from within WordPress administration.⌉[

Customize PHP settings from within WordPress administration.

[⌊A .htaccess file with customized PHP settings.⌉⌊A .htaccess file with customized
PHP settings.⌉[

A `.htaccess` file with customized PHP settings.

[⌊A table with all php settings that can be customized.⌉⌊A table with all php settings
that can be customized.⌉[

A table with all php settings that can be customized.

[⌊Table displaying information about the current php environment.⌉⌊Table displaying
information about the current php environment.⌉[

Table displaying information about the current php environment.

[⌊Listing of all enabled PHP extensions.⌉⌊Listing of all enabled PHP extensions.⌉[

Listing of all enabled PHP extensions.

[⌊All $_SERVER variables.⌉⌊All $_SERVER variables.⌉[

All $_SERVER variables.

[⌊All $_COOKIE variables.⌉⌊All $_COOKIE variables.⌉[

All $_COOKIE variables.

[⌊An example of backed up configuration files.⌉⌊An example of backed up configuration
files.⌉[

An example of backed up configuration files.

[⌊Multiple settings are available in the premium version.⌉⌊Multiple settings are
available in the premium version.⌉[

Multiple settings are available in the premium version.

[⌊The premium version supports setting environment variables.⌉⌊The premium version
supports setting environment variables.⌉[

The premium version supports setting environment variables.

## 安裝方式

 1. Upload custom-php-settings-pro to the **/wp-content/plugins/** directory,
 2. Activate the plugin through the **Plugins** menu in WordPress.
 3. You can now modify your php settings by going to the settings page located under
    _wp-admin/admin.php?page=custom-php-settings-pro_.

## 常見問題集

### I have saved a setting in the editor but the PHP setting does not reflect this?

Make sure so you have checked the _Update configuration file_ checkbox beneath the
editor.

## 使用者評論

![](https://secure.gravatar.com/avatar/39ee98271b6d0af401bf594a274c0ddf636ce60e2f1d3d0d9c4c88cf6c10173b?
s=60&d=retro&r=g)

### 󠀁[very bad](https://wordpress.org/support/topic/very-bad-158/)󠁿

 [picklypickle](https://profiles.wordpress.org/picklypickle/) 2025 年 3 月 19 日

THE worst

![](https://secure.gravatar.com/avatar/daa89d2a0ce10421ad50a89d02691fb7334c5eb5f13c263459bf50fd020f5c56?
s=60&d=retro&r=g)

### 󠀁[Bad got worse](https://wordpress.org/support/topic/bad-got-worse/)󠁿

 [cantoute](https://profiles.wordpress.org/cantoute/) 2024 年 6 月 25 日 1 則留言

The plugin is badly coded… could be handy but since last updates it has decided 
you needed a premium to set vars like post_max_size

![](https://secure.gravatar.com/avatar/caa0479b58a9d6203ac99edc2cded177c49468c0c41d19f67d14acddf8fb2b03?
s=60&d=retro&r=g)

### 󠀁[Amazing so Simple](https://wordpress.org/support/topic/amazing-so-simple/)󠁿

 [deffectrix](https://profiles.wordpress.org/deffectrix/) 2022 年 12 月 5 日

This is an awesome plugin, works like a charm. Thank you.

![](https://secure.gravatar.com/avatar/c70616123cce91c86d92b5515559973ba2c0bc1226be4e48ac68537f3d393adc?
s=60&d=retro&r=g)

### 󠀁[Best PHP-Settings Pluign](https://wordpress.org/support/topic/best-php-settings-pluign/)󠁿

 [offloris](https://profiles.wordpress.org/offloris/) 2022 年 6 月 5 日

When i downloaded the Plugin i have thinked that it wouldnt be work but i was shocked.
It worked!!! Thank you!

![](https://secure.gravatar.com/avatar/239556da976d799f646626bdddfad7a4eb9dd29924c51e71b90bcb7f90c2cd10?
s=60&d=retro&r=g)

### 󠀁[Gorgeous Plugin](https://wordpress.org/support/topic/gorgeous-plugin-6/)󠁿

 [osandigital](https://profiles.wordpress.org/osandigital/) 2022 年 5 月 18 日

This is just “simply” beautiful. Thank you for this. Time-saving.

![](https://secure.gravatar.com/avatar/1af6576b77bb9a70f3e5be2921769896502f27e43d7ac83a1f1293cb414eea3c?
s=60&d=retro&r=g)

### 󠀁[Good one](https://wordpress.org/support/topic/good-one-535/)󠁿

 [barnabas1](https://profiles.wordpress.org/barnabas1/) 2022 年 1 月 29 日

Works for me absolutely fine! Thank you for your work.

 [ 閱讀全部 15 則使用者評論 ](https://wordpress.org/support/plugin/custom-php-settings/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Custom PHP Settings〉的開發相關工作。

參與者

 *   [ cyclonecode ](https://profiles.wordpress.org/cyclonecode/)

〈Custom PHP Settings〉外掛目前已有 1 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/custom-php-settings/contributors)
為這個外掛做出的貢獻。

[將〈Custom PHP Settings〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/custom-php-settings)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/custom-php-settings/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/custom-php-settings/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/custom-php-settings/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/custom-php-settings/)。

## 變更記錄

= 2.4.1

 * Update: Freemius SDK to 2.13.0.
 * Update: Add more WordPress information.
 * Update: Add Server Software in status page.

## 中繼資料

 *  版本 **2.4.1**
 *  最後更新 **7 個月前**
 *  啟用安裝數 **10,000+**
 *  WordPress 版本需求 ** 4.1.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.8.5**
 *  PHP 版本需求 ** 5.6 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/custom-php-settings/) 及 [Swedish](https://sv.wordpress.org/plugins/custom-php-settings/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/custom-php-settings)
 * 標籤:
 * [Apache](https://tw.wordpress.org/plugins/tags/apache/)[htaccess](https://tw.wordpress.org/plugins/tags/htaccess/)
   [php](https://tw.wordpress.org/plugins/tags/php/)[settings](https://tw.wordpress.org/plugins/tags/settings/)
 *  [進階檢視](https://tw.wordpress.org/plugins/custom-php-settings/advanced/)

## 評分

 4.4 星，滿分為 5 星

 *  [  12 個 5 星使用者評論     ](https://wordpress.org/support/plugin/custom-php-settings/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/custom-php-settings/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/custom-php-settings/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/custom-php-settings/reviews/?filter=2)
 *  [  2 個 1 星使用者評論     ](https://wordpress.org/support/plugin/custom-php-settings/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/custom-php-settings/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/custom-php-settings/reviews/)

## 參與者

 *   [ cyclonecode ](https://profiles.wordpress.org/cyclonecode/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/custom-php-settings/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.buymeacoffee.com/cyclonecode)