Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a bug in the Slim PHP framework in Environment.php line 143. In particular, it assumes that the <code>$_SERVER['SCRIPT_NAME']</code> path is compatible with <code>$_SERVER['REQUEST_URI']</code> variable. In most cases this is probably true, however not when using MOD_REWRITE to hide an intermediate directory (as is happening in the .htaccess you quoted).</p> <p>What's happening is <code>$_SERVER['SCRIPT_NAME']</code> looks something like "/public/something..." but (because it is hidden), <code>$_SERVER['REQUEST_URI']</code> looks like "/something...".</p> <p>Slim is assuming the request URI is based on the script name, which is not the case here. I plan on notifying the Slim authors of the bug, but wanted to make note of it here as well.</p> <p>You can fix/work around this by modifying Slim/Environment.php line 143 to this:</p> <pre><code>if (strpos($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']) === 0) { $env['SCRIPT_NAME'] = $_SERVER['SCRIPT_NAME']; //Without URL rewrite $env['PATH_INFO'] = substr_replace($_SERVER['REQUEST_URI'], '', 0, strlen($env['SCRIPT_NAME'])); } else { $env['SCRIPT_NAME'] = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])); //With URL rewrite $env['PATH_INFO'] = $_SERVER['REQUEST_URI']; } // $env['PATH_INFO'] = substr_replace($_SERVER['REQUEST_URI'], '', 0, strlen($env['SCRIPT_NAME'])); </code></pre> <p>At least that seems to work fine in my case. I believe the intention was to remove the path from the request uri, but that seems a pretty horrible way of doing it. If you need subdirectories to keep working you may need to do a bit more thinking. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload