[wordpress插件] Custom PHP Settings自定义PHP设置

wordpress 插件 文章 2020-04-09 00:10 580 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

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

此插件可用于为您的wordpress安装自定义php设置。

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.

该插件将修改 .htaccess 文件或 .user.ini 文件,以便直接在设置页面中更改当前php设置。

>

>

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

由于需要修改配置文件,因此该插件必须是可写的,此插件才能正常工作。

Apache module

Apache模块

When PHP is running as an Apache module the .htaccess file will be used to set customized settings;

当PHP作为Apache模块运行时, .htaccess 文件将用于设置自定义设置;

make sure so that this file exists and is writable by the webserver.

确保该文件存在并且可由网络服务器可写

CGI/Fast-CGI

CGI / Fast-CGI

If instead PHP is running in CGI/Fast-CGI mode then a custom INI file will be used.

如果PHP是以CGI / Fast-CGI模式运行,则将使用自定义INI文件。

The name of this file depends on the value of user_ini.filename in the php configuration, by default it is .user.ini.

该文件的名称取决于php配置中 user_ini.filename 的值,默认情况下为 .user.ini

You can check the name of you custom INI file in the PHP Information table.

您可以在 PHP信息表中检查自定义INI文件的名称。

The custom INI file should be placed under the root folder and most be writable by the webserver.

自定义INI文件应放在根文件夹下,并且应由网络服务器可写

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.

请注意,信息表中还有一个用户INI文件缓存TTL 值,该值指示自定义INI文件在重新加载之前将被缓存多长时间。

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.

例如,如果此值设置为300,则对自定义INI文件所做的任何更改最多5分钟都不会反映出来。

The name for this setting in the php configuration is user_ini.cache_ttl.

php配置中此设置的名称为 user_ini.cache_ttl

On important thing is to make sure that your .user.ini file is blocked by your webserver.

重要的是要确保您的 .user.ini 文件被您的Web服务器阻止。

If you are running NGINX this can be done by adding:

如果您正在运行NGINX,则可以通过添加以下内容来实现:

location ~ /\.user\.ini {  

 位置〜/\.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:

如果尚未完成,则通过在配置中添加以下内容来完成使用Apache的相同操作:

  

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.

设置表将显示所有可以由插件自定义的非系统php设置。

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.

某些设置可能会以红色显示,因为它们可能是通过自定义的php.ini文件,wordpress本身,插件或其他方式在其他地方更改的。

For instance if you have enabled WP_DEBUG in your wp-config.php file the error_reporting setting will turn red.

例如,如果您在 wp-config.php 文件中启用了 WP_DEBUG ,则 error_reporting 设置将变为红色。

If you have questions or perhaps some idea on things that should be added you can also try

如果您对应该添加的内容有疑问或想法,也可以尝试

slack or skype.

松弛或 skype

Resources

资源

A complete list of settings that can be modified can be found here: List of php.

可以在此处找到可以修改的设置的完整列表: php列表。

ini directives

ini指令

Notice that directives marked as PHP_INI_SYSTEM can not be modified.

请注意,标记为 PHP_INI_SYSTEM 的指令无法修改。

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:

variables_order 配置就是一个很好的例子:

Sets the order of the EGPCS (Environment, Get, Post, Cookie, and Server) variable parsing.

设置EGPCS(环境,获取,发布,Cookie和服务器)变量解析的顺序。

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.

例如,如果variables_order设置为“ SP”,则PHP将创建超全局变量$ _SERVER和$ _POST,但不会创建$ _ENV,$ _ GET和$ _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.

如果将此值配置为 EPCS ,则不会设置 $ _ GET 超全局变量,这将使您的页面无法访问。

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.

另一个示例是将 post_max_size 设置为一个非常低的值,这样就不会将表单数据发送到服务器,从而导致该表单数据永远不会保存。

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:

如果您错误地更改了某些值,并且现在无法访问您的网站,则可以简单地手动删除 .htaccess 文件中插件标记之间的所有内容:

# BEGIN CUSTOM PHP SETTINGS

 #开始自定义PHP设置

php_value variables_order EPCS <-- Remove

php_value variables_order EPCS <-删除

# END CUSTOM PHP SETTINGS

#结束自定义PHP设置

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.

您还可以尝试通过

安装步骤

    1. Upload custom-php-settings to the /wp-content/plugins/ directory,
    2. 将自定义php设置上传到 / wp-content / plugins / 目录,

    3. Activate the plugin through the Plugins menu in WordPress.
    4. 通过WordPress中的插件菜单激活插件。

    5. You can now modify your php settings by going to the settings page located under wp-admin/tools.php?page=custom-php-settings.
    6. 您现在可以通过转到 wp-admin / tools.php?page = custom-php-settings 下的设置页面来修改php设置。

下载地址
https://downloads.wordpress.org/plugin/custom-php-settings.1.2.6.zip
-EOF-

AI助手支持GPT4.0