gpt4 book ai didi

php - apache/linux 版本之间 PHP GLOBALS 的差异

转载 作者:太空宇宙 更新时间:2023-11-04 04:02:24 25 4
gpt4 key购买 nike

这可能是提出有关 php 和 apache 问题的更好方法。我有两台服务器,当我从 php.ini 中 print_r($GLOBALS) 时,它们具有非常不同的全局变量。差异如下。有人可以解释为什么测试服务器调用不显示任何 _SERVER 设置吗?

—————运行 Ubuntu 13.10 的测试服务器的配置 ————————

Array
(
[_GET] => Array
(
[r] => 2
)

[_POST] => Array
(
)

[_COOKIE] => Array
(
[__utma] => etc
)

[_FILES] => Array
(
)

[GLOBALS] => Array
*RECURSION*
)

————来自运行 Ubuntu 12.04 的生产服务器的配置 ——————

Array
(
[GLOBALS] => Array
*RECURSION*
[_POST] => Array
(
)

[_GET] => Array
(
[r] => 1
)

[_COOKIE] => Array
(
[__utma] => etc
)

[_FILES] => Array
(
)

[_REQUEST] => Array
(
[r] => 1
)

[_SERVER] => Array
(
[HTTPS] => on
[SSL_TLS_SNI] => tgg.xxx.com
[HTTP_HOST] => tgg.xxx.com
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:27.0) Gecko/20100101 Firefox/27.0
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_COOKIE] => xxx
[HTTP_CONNECTION] => keep-alive
[PATH] => /usr/local/bin:/usr/bin:/bin
[SERVER_SIGNATURE] =>
Apache/2.2.22 (Ubuntu) Server at tgg.xxx.com Port 443

[SERVER_SOFTWARE] => Apache/2.2.22 (Ubuntu)
[SERVER_NAME] => tgg.xxx.com
[SERVER_ADDR] => 192.241.179.123
[SERVER_PORT] => 443
[REMOTE_ADDR] => 67.79.197.222
[DOCUMENT_ROOT] => /var/www/xxx
[SERVER_ADMIN] => [no address given]
[SCRIPT_FILENAME] => /var/www/xxx/index.php
[REMOTE_PORT] => 60665
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => r=1
[REQUEST_URI] => /index.php?r=1
[SCRIPT_NAME] => /index.php
[PHP_SELF] => /index.php
[REQUEST_TIME] => 1395338407
)

[ignoreAuth] => 1
)

最佳答案

检查两个 php.ini 文件是否相同。核心 php.ini 指令允许您获取/设置 PHP 设置配置。因此,在使用 print_r(...) 之前尝试设置 auto-globals-jut = 1请参阅this link

关于php - apache/linux 版本之间 PHP GLOBALS 的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22544031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com