我们的开发人员都在他们的本地计算机上工作,我们遇到的问题是$ _GET在服务器上被切断但在本地没有。 (MAC,Apache / MySQL构建-NOT MAMP)
CENTOS上有这样的设置吗?
上的代码相同,数据库相同这是正确的URI
[REQUEST_URI] => /mapp/index/redirectToCart?productID=732&product=732&related_product=&qty=
从服务器(CentOS 6.5版(最终版))
Array
(
[HTTP_AUTHORIZATION] =>
[HTTPS] => on
[SSL_TLS_SNI] => www.mydomain.com
[SSL_SERVER_S_DN_OU] => Domain Control Validated
[SSL_SERVER_S_DN_CN] => mydomain.com
......
[HTTP_HOST] => www.mydomain.com
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_CONNECTION] => keep-alive
[HTTP_COOKIE] => frontend=rb7ehmse7lfrile9q0o5gkj0h1; CATEGORY_INFO=%5B%5D; LAST_CATEGORY=3403; VIEWED_PRODUCT_IDS=732; _ga=GA1.2.549931750.1410525313; _gat=1
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2
[HTTP_ACCEPT_LANGUAGE] => en-us
[HTTP_REFERER] => http://www.mydomain.com/apw-wyott-cheesemelter-countertop-36-wide-ea.html
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[PATH] => /sbin:/usr/sbin:/bin:/usr/bin
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache
[SERVER_NAME] => www.mydomain.com
[SERVER_ADDR] => 10.2.5.5
[SERVER_PORT] => 443
[REMOTE_ADDR] => [removed]
[DOCUMENT_ROOT] => /var/www/mydomain.com/staging/current/
[SERVER_ADMIN] => webmaster@mydomain.com
[SCRIPT_FILENAME] => /var/www/mydomain.com/staging/current/index.php
[REMOTE_PORT] => 15070
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /index.php/mapp/index/redirectToCart
[SCRIPT_NAME] => /index.php
[PATH_INFO] => /mapp/index/redirectToCart
[PATH_TRANSLATED] => redirect:/index.php/index/redirectToCart
[PHP_SELF] => /index.php/mapp/index/redirectToCart
[REQUEST_TIME_FLOAT] => 1410543560.059
[REQUEST_TIME] => 1410543560
)
来自本地
Array
(
[REDIRECT_HTTP_AUTHORIZATION] =>
[REDIRECT_STATUS] => 200
[HTTP_AUTHORIZATION] =>
[HTTP_HOST] => fsss.local
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_CONNECTION] => keep-alive
[HTTP_COOKIE] => _ga=GA1.2.2052654414.1410539051; CART=1af3799f2a75e89cb32e44ba38ab155d; CUSTOMER=37853b37ccdeca3c78270537e91e1f58; CUSTOMER_INFO=d65ce707afe805e0549ec6b9f8c68708; frontend=ru4dl80guqbho0h979srj4str0; persistent_shopping_cart=zblxqfEcDKDmSbs8o2mJFqoOUv56aFRabxIlnqEfL2WNukdAzp; VIEWED_PRODUCT_IDS=732
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2
[HTTP_ACCEPT_LANGUAGE] => en-us
[HTTP_REFERER] => http://client.local/apw-wyott-cheesemelter-countertop-36-wide-ea.html
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[PATH] => /usr/bin:/bin:/usr/sbin:/sbin
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache/2.2.26 (Unix) PHP/5.4.24 Phusion_Passenger/4.0.40 DAV/2 mod_ssl/2.2.26 OpenSSL/0.9.8y mod_perl/2.0.7 Perl/v5.16.2
[SERVER_NAME] => client.local
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => /Volumes/Data/prjs/sources/mydomain/
[SERVER_ADMIN] => [revoved]
[SCRIPT_FILENAME] => /Volumes/Data/prjs/sources/mydomain/index.php
[REMOTE_PORT] => 57218
[REDIRECT_QUERY_STRING] => productID=732&product=732&related_product=&qty=0
[REDIRECT_URL] => /mapp/index/redirectToCart
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => productID=732&product=732&related_product=&qty=0
[REQUEST_URI] => /mapp/index/redirectToCart?productID=732&product=732&related_product=&qty=0
[SCRIPT_NAME] => /index.php
[PHP_SELF] => /index.php
[REQUEST_TIME_FLOAT] => 1410543740.533
[REQUEST_TIME] => 1410543740
)
答案 0 :(得分:0)
这是Apache / httpd.conf和PHP / php.ini的设置。在CentOS中,您可以配置php.ini文件,或者我不确定您是否也在使用cPanel,您可以在cPanel WHM用户界面面板上配置整个集。
我会看看如何配置CentOS / PHP配置以解决问题。对于这些与Ubuntu相比,CentOS有点奇怪。
最大的原因之一可能是在您的应用中,CentOS会处理REQUEST_URI路径 与您的应用配置设置不同。不是听起来很消极,Mac和CentOS完全不同。你肯定会遇到问题。
答案 1 :(得分:0)
如果我是你,我会用它:
<?php
function request_URI() {
if(!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if($_SERVER['QUERY_STRING']) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
return $_SERVER['REQUEST_URI'];
}
$_SERVER['REQUEST_URI'] = request_URI();
&GT;