前言介紹
- 這款 WordPress 外掛「Custom PHP Settings」是 2019-02-24 上架。
- 目前有 10000 個安裝啟用數。
- 上一次更新是 2025-02-09,距離現在已有 83 天。
- 外掛最低要求 WordPress 4.1.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 15 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
php | Apache | apache2 | htaccess | settings |
內容簡介
這個外掛可以用來自訂你 WordPress 安裝的 PHP 設定。這個外掛會修改 .htaccess 檔案或 .user.ini 檔案,以便直接從設定頁面更改目前的 PHP 設定。由於需要修改設定檔案,這個檔案必須是可寫的,才能正確運作。
尋找幫助:目前正在尋找願意幫忙以下事項的人:
1. 創建一個可以在管理員菜單中使用的儀表板圖標。
2. 創建一個將顯示在 wordpress.org 上的插件主頁的橫幅。
3. 設計一個更美觀、更直觀的管理介面。
4. 創建一個可以在多個地方使用的外觀鮮明的圖標。
如果你想幫忙以上任何事項,請不要猶豫,通過 Slack 或電子郵件與我聯繫。
專業版:專業版具有擴展功能,例如:
1. 支持在 .htaccess 檔案中設置環境變數。
2. 支持從設定頁面啟用/禁用 WP_DEBUG。
3. 啟用錯誤記錄並設置日誌檔案路徑。
4. 大部分可配置 PHP 設置的提示。
5. 支持在應用任何更改之前備份您的設定檔案。
6. 創建可以用於輕鬆切換不同設置的多個配置。
7. 擴展支持。
你可以用 15 歐元的價格購買專業版,或者買幾杯啤酒給我在 buymeacoffee 上。請不要忘記添加你的電子郵件地址或其他聯繫方式,我會回復你並發送有關如何獲取專業版的說明。
專業版許可證有效期為一年,可以用於最多三個站點。
Apache 模組:當 PHP 作為 Apache 模組運行時,將使用 .htaccess 檔案來設置自定義設置。請確保這個檔案存在並可被 Web 服務器寫入。
CGI/Fast-CGI:如果 PHP 是在 CGI/Fast-CGI 模式下運行,則會使用自定義的 INI 檔案。這個檔案的名稱取決於 PHP 配置中 user_ini.filename 的值,默認為 .user.ini。你可以在 PHP 資訊表中檢查你自定義的 INI 檔案的名稱。自定義的 INI 檔案應放在根資料夾下,並且 Web 服務器必須能夠寫入它。
請注意,PHP 資訊表中還有一個 User INI 檔案快取 TTL 值,這個值表示在重新加載之前自定義的 INI 檔案將被緩存多長時間。例如,如果這個值設置為 300,則對自定義的 INI 檔案的任何更改在最多 5 分鐘內都不會反映出來。在 PHP 配置中,這個設置的名稱是 user_ini.cache_ttl。
重要的一件事是要確保你的 .user.ini 檔案被你的 Web 服務器阻止。如果你使用的是 NGINX,可以通過添加以下內容來達到此目的:
location ~ /\.user\.ini {
deny all;
}
如果你使用的是 Apache,可以通過添加以下內容來達到此目的(如果尚未添加):
order allow,deny
deny from all
可用設定:設定表格將顯示所有可由外掛自定義的非系統 PHP 設定。所有修改過的設定都會在表格中以紅色顯示。有些設定可能會以... 為結尾,這是由於它們太長而被截斷。
原文外掛簡介
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:
order allow,deny
deny from all
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.
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
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
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Custom PHP Settings」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.4.4 | 1.4.5 | 1.4.6 | 1.4.7 | 2.0.0 | 2.1.0 | 2.1.1 | 2.1.2 | 2.1.3 | 2.1.4 | 2.1.5 | 2.2.0 | 2.2.1 | 2.2.2 | 2.3.0 | 2.3.1 | 2.3.2 | trunk |
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。