PHP - cgi.fix_pathinfo = 1 - 在网络服务器上的 php.ini 中有什么影响(wp)

标签 php wordpress ini

在我的服务器上,主机提供了一些替代的 PHP.ini 配置。

唯一具有扩展 Zip(我需要)的描述为:

zip_cgi.fix_pathinfo

Advanced settings for experienced users with: cgi.fix_pathinfo = 1 and Extension Zip Enabled

我主要为 wordpress 使用该网站,但我想知道这可能产生的影响(或意义)是什么。

来自:http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo

Provides real PATH_INFO/ PATH_TRANSLATED support for CGI. PHP's previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok what PATH_INFO is. For more information on PATH_INFO, see the CGI specs. Setting this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting of zero causes PHP to behave as before. It is turned on by default. You should fix your scripts to use SCRIPT_FILENAME rather than PATH_TRANSLATED.

搜索google只提供了模糊的结果,以及直接询问主机(调用中心的女孩不太明白,技术人员也没有回应..)

最佳答案

ZIP 扩展似乎希望 URL 作为 PATH_INFO 变量传递。 PHP 的 CGI 和 FastCGI 实现没有可用的 PATH_INFO,因此当尝试传递 URI 时,PHP 失败。一种解决方法是将 cgi.fix_pathinfo 设置为 true。

关于PHP - cgi.fix_pathinfo = 1 - 在网络服务器上的 php.ini 中有什么影响(wp),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15493207/

相关文章:

java - 具体如何测试? (单元测试、JUnit、PhpUnit)

php - 覆盖静态变量

c# - 读取/写入 INI 文件

PowerShell 从简单的 .ini 文件中读取单个值

php - 无法在 php 中正确比较时间

php - 类中的排序函数

PHP Wordpress 插件 - 函数输出可以,但更新数据库时不行。

php - 为 WORDPRESS 导入表时出错(位置 25 附近的 "ON")(外键错误)

php - 在自定义帖子类型存档的模板中设置 Yoast 标题

python - 如何在 Python 程序中实现设置文件