Skip to content

Commit

Permalink
Merge pull request #823 from f0o/nginx-path
Browse files Browse the repository at this point in the history
Added nginx-hack to fix missing $_SERVER[PATH_INFO]
  • Loading branch information
laf committed Apr 17, 2015
2 parents 823ab35 + 169353d commit 47d36f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion html/index.php
Expand Up @@ -12,7 +12,11 @@
*
*/

$_SERVER['PATH_INFO'] = !empty($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : (!empty($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : '');
if( strstr($_SERVER['SERVER_SOFTWARE'],"nginx") ) {
$_SERVER['PATH_INFO'] = str_replace($_SERVER['PATH_TRANSLATED'].$_SERVER['PHP_SELF'],"",$_SERVER['ORIG_SCRIPT_FILENAME']);
} else {
$_SERVER['PATH_INFO'] = !empty($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : (!empty($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : '');
}

function logErrors($errno, $errstr, $errfile, $errline) {
global $php_debug;
Expand Down

0 comments on commit 47d36f4

Please sign in to comment.