$_SERVER[‘SCRIPT_URI’]为空解决办法

首先$_SERVER['SCRIPT_URI']需要Apache mod_rewrite 模块的支持,如果服务器没有开启开启
 
httpd.conf文件中
LoadModule rewrite_module modules/mod_rewrite.so
 
然后在站点配置中增加 RewriteEngine On
 
<VirtualHost *:80>
    RewriteEngine On
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "D:/xampp/htdocs/phpff"
    ServerName www.phpff.com
    ServerAlias www.phpff.com
    ErrorLog "logs/phpff-error.log"
    CustomLog "logs/phpff-access.log" combined
</VirtualHost>